You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QfcItemController.UiThreadDispatcherFixtureTests.Transaction_SecondCallerCannotInstallUntilTheFirstRestores, which failed once in CI on an earlier Bug: package-manifest-consistency-residuals #929 head.
Environment
OS/version: Windows 11 (local, with concurrent coverage runs) and windows-latest (CI)
Command/flags used: Invoke-MSTestWithCoverage.ps1, and the CI MSTest-with-coverage required check
Data source or fixture: n/a
Steps to Reproduce
Run QuickFiler.Test under the parallel regime while the machine is loaded, for example with a second coverage run.
Observe intermittent failures in the tests named above.
Expected Behavior
The tests are deterministic regardless of machine load.
Actual Behavior
QuickFiler.Test/Controllers/QfcDatamodelLivenessTests.cs uses SpinWait.SpinUntil(condition, TimeSpan.FromSeconds(5)) (line ~56) and .Task.Wait(TimeSpan.FromSeconds(5)) (lines ~103 and ~173). A slow scheduler turns these into assertion failures.
QuickFiler.Test/Controllers/QfcItemController.UiThreadDispatcherFixtureTests.cs:206 fails intermittently. Its cause is not yet established.
Restoring sections dropped by the promotion tooling.
Suspected Cause / Notes
Real-time bounded waits violate the repository determinism rules: no wall-clock waits in tests, and use of FakeTimeProvider or a controllable scheduler.
QfcDatamodelLivenessTests.cs uses SpinWait.SpinUntil(..., TimeSpan.FromSeconds(5)) (line ~56) and .Task.Wait(TimeSpan.FromSeconds(5)) (lines ~103 and ~173).
The transaction test (QfcItemController.UiThreadDispatcherFixtureTests.cs:206) may be a different root cause. Triage it first, and split it into its own issue if its cause is not timing.
This hits a required check. #944 needed a one-time gate re-run because of it.
Proposed Fix / Validation Ideas
Replace the bounded waits with deterministic completion signals (TaskCompletionSource or awaited handles) or an injected TimeProvider.
Use no retries, [DoNotParallelize], Workers=1 or longer timeouts, and find any raced static state.
Negative control: show that each rewritten test fails when the awaited signal is never set.
Both waits come from the same cause: QfcDatamodel.InitEmailQueue starts its worker on a thread pool the test cannot control. Fix them with the same seam #950 introduces. They can be included in #950's scope, or taken on in a follow-up branch immediately after #950 merges.
The research also found that the transaction test failure (Transaction_SecondCallerCannotInstallUntilTheFirstRestores) has a different cause: UiThreadDispatcherFixture.EnsureDispatcher() replaces the shared dispatcher without taking the lock that guards it, while QfcItemController_FocusAndThemeTests runs in parallel. The proposed fix changes only test code and stays within #950.
Activity
drmoisan commentedon Sep 30, 2026
Restoring sections dropped by the promotion tooling.
Suspected Cause / Notes
Real-time bounded waits violate the repository determinism rules: no wall-clock waits in tests, and use of
FakeTimeProvideror a controllable scheduler.QfcDatamodelLivenessTests.csusesSpinWait.SpinUntil(..., TimeSpan.FromSeconds(5))(line ~56) and.Task.Wait(TimeSpan.FromSeconds(5))(lines ~103 and ~173).QfcItemController.UiThreadDispatcherFixtureTests.cs:206) may be a different root cause. Triage it first, and split it into its own issue if its cause is not timing.This hits a required check. #944 needed a one-time gate re-run because of it.
Proposed Fix / Validation Ideas
TaskCompletionSourceor awaited handles) or an injectedTimeProvider.[DoNotParallelize], Workers=1 or longer timeouts, and find any raced static state.drmoisan commentedon Oct 1, 2026
Scope note from the #950 preparation research.
The same bounded wall-clock wait pattern also exists in:
QuickFiler.Test/Controllers/QfcDatamodelTeardownTests.csQuickFiler.Test/Controllers/QfcInitEmailQueueZeroBatchTests.csBoth waits come from the same cause:
QfcDatamodel.InitEmailQueuestarts its worker on a thread pool the test cannot control. Fix them with the same seam #950 introduces. They can be included in #950's scope, or taken on in a follow-up branch immediately after #950 merges.The research also found that the transaction test failure (
Transaction_SecondCallerCannotInstallUntilTheFirstRestores) has a different cause:UiThreadDispatcherFixture.EnsureDispatcher()replaces the shared dispatcher without taking the lock that guards it, whileQfcItemController_FocusAndThemeTestsruns in parallel. The proposed fix changes only test code and stays within #950.