modelcontextprotocol / modelcontextprotocol/csharp-sdk
Flaky test host hang on Windows Debug CI: TaskCancellationIntegrationTests.TaskTool_CancellationToken_GetTaskShowsWorkingBeforeCancel
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 4.5k
- Forks
- 814
- Ø Merge
- 9 T. 19 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
Summary
The build (windows-latest, Debug) CI leg intermittently fails because the ModelContextProtocol.Tests test host hangs and is killed after the 7-minute blame inactivity timeout. When the hang was captured, the test executing was:
ModelContextProtocol.Tests.Server.TaskCancellationIntegrationTests.TaskTool_CancellationToken_GetTaskShowsWorkingBeforeCancel
(The blame collector notes "This test may, or may not be the source of the crash.")
This appears to be a flaky / non-deterministic hang — the same assembly passes on the other target frameworks in the same run, and the failure only reproduces intermittently on the Windows Debug leg.
Occurrence
- Run:
29271612002, jobbuild (windows-latest, Debug)(attempt 2) - Job log: https://github.com/modelcontextprotocol/csharp-sdk/actions/runs/29271612002/job/86940026088
- Observed on PR #1700 (the PR diff only touches OAuth client PKCE metadata validation and its tests — unrelated to task cancellation — so this is very likely a pre-existing flake rather than a regression).
Relevant log excerpt
Passed! - Failed: 0, Passed: 2273, Skipped: 4, Total: 2277, Duration: 6 m 33 s - ModelContextProtocol.Tests.dll (net10.0)
Passed! - Failed: 0, Passed: 2273, Skipped: 4, Total: 2277, Duration: 6 m 9 s - ModelContextProtocol.Tests.dll (net8.0)
Passed! - Failed: 0, Passed: 1974, Skipped: 278, Total: 2252, Duration: 6 m 30 s - ModelContextProtocol.Tests.exe (net472)
The active test run was aborted. Reason: Test host process crashed
Data collector 'Blame' message: The specified inactivity time of 7 minutes has elapsed. Collecting hang dumps from testhost and its child processes.
Data collector 'Blame' message: Dumping this process tree (from bottom).
Data collector 'Blame' message: > 5068 - testhost.
Data collector 'Blame' message: +- 6860 - ModelContextProtocol.Tests.
Passed! - Failed: 0, Passed: 2268, Skipped: 4, Total: 2272, Duration: 6 m 27 s - ModelContextProtocol.Tests.dll (net9.0)
Test Run Aborted.
The active Test Run was aborted because the host process exited unexpectedly. Please inspect the call stack above, if available, to get more information about where the exception originated from.
The test running when the crash occurred:
ModelContextProtocol.Tests.Server.TaskCancellationIntegrationTests.TaskTool_CancellationToken_GetTaskShowsWorkingBeforeCancel
This test may, or may not be the source of the crash.
Attachments:
...\ModelContextProtocol.Tests_6860_20260713T214733_hangdump.dmp
...\testhost_5068_20260713T214741_hangdump.dmp
...\Sequence_6dd0728684124ee1a0d9e35a4ba318c2.xml
make: *** [Makefile:19: test] Error 1
##[error]Process completed with exit code 1
Hang dumps (ModelContextProtocol.Tests_6860_*.hangdump.dmp, testhost_5068_*.hangdump.dmp) and the blame Sequence_*.xml are attached to the run as test-result artifacts and should contain the managed call stack of the hung thread.
Notes for debugging
procdump64.exe could not be foundappears earlier in the log, so only the .NET hang dump (not a full crash dump via procdump) was collected — worth downloading the*hangdump.dmpartifacts and inspecting the blocked thread's stack (e.g. viadotnet-dump analyze→clrstack).TaskCancellationIntegrationTests.TaskTool_CancellationToken_GetTaskShowsWorkingBeforeCancelcoordinates a working→cancel transition; a missed signal / await that never completes is a plausible cause of the inactivity hang. The Sequence XML will confirm whether it was mid-execution or already completed when the host hung.
Expected
The Windows Debug test leg should complete deterministically without hanging.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit ModelContextProtocol.Tests.Server.TaskCancellationIntegrationTests.TaskTool_CancellationToken_GetTaskShowsWorkingBeforeCancel und dem Windows Debug CI-Log für Run 29271612002. Lade die angehängten Hang-Dumps und die Sequence XML herunter und verwende anschließend dotnet-dump analyze und clrstack, um den blockierten Thread zu untersuchen und festzustellen, ob der Test noch ausgeführt wurde. Als erledigt gilt die Aufgabe, wenn der Windows Debug-Testlauf deterministisch ohne einen Host-Hang abgeschlossen wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- ci-cd, testing-qa
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100