Skip to content

Stabilize startup-handoff watch test under parallel full-suite load #4939

Description

@Widthdom

Summary

The full test suite can intermittently fail IndexWatchRunnerTests.RunCore_StartupHandoff_ReconcilesMutationAndDrainsBeforeReady_Issue4594 under parallel load because the expected startup-drain event is absent even though startup rescan and watch readiness are emitted.

Observed during unrelated adversarial validation for #4848.

Reproduction evidence

Command:

dotnet test --no-restore

The failure was at IndexWatchRunnerTests.cs:1291:

Assert.True(startupDrain > startupRescan, capturedOut)

The captured JSON transcript contained the startup rescanned event and later watching/stopped events, but no "status":"updated","phase":"startup" event in the required position. The same test passed when rerun alone on net8.0 (about 13 seconds), which suggests a scheduling/load-sensitive handoff assertion rather than a deterministic product failure.

Expected behavior

The startup-handoff fixture should deterministically prove that a mutation queued at the scan-to-watch boundary is reconciled before readiness, without depending on whether the initial rescan already observes that mutation under full-suite scheduling.

Suggested scope

  • Make the fixture's scan/handoff ordering deterministic, or accept the equivalent transcript where the startup rescan already contains the mutation.
  • Preserve the core assertion that AfterHandoff is indexed, BeforeHandoff is removed, and readiness is not emitted before reconciliation.
  • Exercise the test under the normal multi-target full-suite load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions