Skip to content

Bug: terminal-notification-hook-test-lacks-sync-barrier #751

Description

@drmoisan
  • Work Mode: full-bug

Summary

AppOlObjectsFolderTreeServiceLifecycleTests.TerminalNotificationHookFailure_DoesNotReplaceDispatchFault in TaskMaster.Test/AppGlobals/AppOlObjectsFolderTreeServiceTests.cs asserts sut.InvokedTerminalHookCount.Should().Be(1) immediately after await run.Operation.ReleaseAsync() with no synchronization barrier guaranteeing the terminal hook has executed. The test is non-deterministic and failed once on CI with identical code passing on re-run.

Environment

  • OS/version: GitHub Actions windows-latest runner (CI job mstest-coverage / Run MSTest suite with coverage); also reproducible in principle on any Windows host running the MSTest suite.
  • Python version: n/a (C# / MSTest).
  • Command/flags used: vstest.console.exe TaskMaster.Test\bin\Debug\TaskMaster.Test.dll /EnableCodeCoverage /InIsolation (the CI coverage step).
  • Data source or fixture: ControlledUiDispatcher(DispatchMode.Pending, fault: ...) with CreateSut(dispatcher, throwFromTerminalHook: true); no external data.

Steps to Reproduce

  1. Check out main at or after merge commit a679cd08 (PR fix(729): remove test-determinism debt via TimeProvider seam, live Form removal, and Console.Out serialization #746).
  2. Run the TaskMaster.Test assembly repeatedly under vstest (loop or CI re-runs).
  3. Observe TerminalNotificationHookFailure_DoesNotReplaceDispatchFault intermittently fail with Expected sut.InvokedTerminalHookCount to be 1, but found 0.

Expected Behavior

The test deterministically observes the terminal hook invocation before asserting on InvokedTerminalHookCount, and passes on every run.

Actual Behavior

On PR #746 the mstest-coverage required check failed once asserting InvokedTerminalHookCount to be 1 and finding 0, then passed on re-run. The same check had already passed against head e6c488bf, which contained every production and test change; the only delta to the failing head was three Markdown audit files, so identical code produced opposite outcomes.

Logs / Screenshots

Impact / Severity

  • Blocker
  • High
  • Medium
  • Low

Medium: a flaky required CI check blocks unrelated pull requests and forces re-runs; it also violates the determinism requirement in the General Unit Test Policy (UT1) and the test-determinism objective of issue #729.

Source

From: docs/features/potential/2026-09-03-terminal-notification-hook-test-lacks-sync-barrier.md

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions