Skip to content

Stabilize net9 MCP lifecycle tests under full-suite load #5001

Description

@Widthdom

Summary

Two existing MCP lifecycle tests failed intermittently during a full net9.0 suite run under sustained load:

  • McpServerTests.DrainInFlightTasksAsync_CancelledTokenSkipsEofDelay_Issue3400 exceeded its timing assertion (1.67 seconds) and passed on isolated rerun.
  • McpServerTests.ProcessFrameAsync_BatchDuplicateInitializeDoesNotReplaceTimedOutPriorGeneration_Issue4540_Issue4545_Issue4848 observed a null response in the full run, failed once again in isolation, and passed on the next isolated rerun.

Reproduction

dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release -f net9.0 -p:UseSharedCompilation=false --no-restore

Observed full-run result: 10,497 passed, 420 skipped, 2 failed over 1h14m. The focused issue #4899 prompt tests passed on both net8.0 and net9.0, and neither flaky test shares the changed prompt path.

Expected

The lifecycle tests should remain deterministic under full-suite load, using explicit synchronization rather than host timing where needed.

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