Summary
Two tests in QuickFiler.Controllers.Tests.QfcItemController_InitializationTests
fail intermittently during a full-suite run with
InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created, but pass every time when the class is
run in isolation. The tests exercise a real WinForms Control.Invoke path with
no seam, so they depend on whether the control's window handle happens to exist
when the test reaches it.
Environment
- OS/version: Windows 11 Pro 10.0.26200
- Python version: n/a (C# / .NET Framework 4.8.1, MSTest)
- Command/flags used:
vstest.console.exe <9 test assemblies> /EnableCodeCoverage /InIsolation /Logger:trx /TestCaseFilter:"TestCategory!=LiveOutlook"
- Data source or fixture: none; the failure is in test-host state, not data
Steps to Reproduce
- Build the solution in Debug.
- Run the full suite across all nine
*.Test.dll assemblies with the command
above.
- Repeat. The two tests below fail on some runs and pass on others.
Observed on 2026-08-15: run 1 passed both tests, run 2 failed both, run 3 (full
suite) passed both. Running only
/TestCaseFilter:"FullyQualifiedName~QfcItemController_InitializationTests"
passed 9 of 9 on every attempt.
Expected Behavior
Per .claude/rules/general-unit-test.md, tests are deterministic: identical
inputs and environment produce identical results, and the suite does not depend
on ordering or on ambient UI state.
Actual Behavior
Both of the following fail non-deterministically:
InitializeNineArgOverload_ThroughThePumpHost_SavesParametersAndDelegates
InitializeBool_ThroughThePumpHost_CompletesAndInitializesState
System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a
control until the window handle has been created.
at System.Windows.Forms.Control.MarshaledInvoke(...)
at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
at QuickFiler.ItemViewer.QuickFiler.IItemViewer.Invoke(Delegate method)
at QuickFiler.Controllers.QfcItemController.InvokeBeginInvoke(Boolean async, Action action)
in QuickFiler\Controllers\QfcItemController.FocusAndTheme.cs:line 256
at QuickFiler.Controllers.QfcItemController.ToggleTips(Boolean async, ToggleState desiredState)
in QuickFiler\Controllers\QfcItemController.FocusAndTheme.cs:line 204
Logs / Screenshots
Impact / Severity
The failure is intermittent and does not indicate a production defect, but a
flaky test in a protected gate is corrosive: it trains reviewers to re-run
rather than investigate, and it can fail an otherwise-green CI run at random.
Source
From: docs/features/potential/2026-08-15-qfc-item-controller-init-tests-flaky-window-handle.md
Summary
Two tests in
QuickFiler.Controllers.Tests.QfcItemController_InitializationTestsfail intermittently during a full-suite run with
InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created, but pass every time when the class isrun in isolation. The tests exercise a real WinForms
Control.Invokepath withno seam, so they depend on whether the control's window handle happens to exist
when the test reaches it.
Environment
vstest.console.exe <9 test assemblies> /EnableCodeCoverage /InIsolation /Logger:trx /TestCaseFilter:"TestCategory!=LiveOutlook"Steps to Reproduce
*.Test.dllassemblies with the commandabove.
Observed on 2026-08-15: run 1 passed both tests, run 2 failed both, run 3 (full
suite) passed both. Running only
/TestCaseFilter:"FullyQualifiedName~QfcItemController_InitializationTests"passed 9 of 9 on every attempt.
Expected Behavior
Per
.claude/rules/general-unit-test.md, tests are deterministic: identicalinputs and environment produce identical results, and the suite does not depend
on ordering or on ambient UI state.
Actual Behavior
Both of the following fail non-deterministically:
InitializeNineArgOverload_ThroughThePumpHost_SavesParametersAndDelegatesInitializeBool_ThroughThePumpHost_CompletesAndInitializesStateLogs / Screenshots
2026-08-15.
Impact / Severity
The failure is intermittent and does not indicate a production defect, but a
flaky test in a protected gate is corrosive: it trains reviewers to re-run
rather than investigate, and it can fail an otherwise-green CI run at random.
Source
From: docs/features/potential/2026-08-15-qfc-item-controller-init-tests-flaky-window-handle.md