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.
Summary
Two existing MCP lifecycle tests failed intermittently during a full net9.0 suite run under sustained load:
McpServerTests.DrainInFlightTasksAsync_CancelledTokenSkipsEofDelay_Issue3400exceeded its timing assertion (1.67 seconds) and passed on isolated rerun.McpServerTests.ProcessFrameAsync_BatchDuplicateInitializeDoesNotReplaceTimedOutPriorGeneration_Issue4540_Issue4545_Issue4848observed 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-restoreObserved 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.