Flaky test host hang on Windows Debug CI: TaskCancellationIntegrationTests.TaskTool_CancellationToken_GetTaskShowsWorkingBeforeCancel
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- csharp
- Domain
- ci-cd, testing-qa
Research direction
Start with ModelContextProtocol.Tests.Server.TaskCancellationIntegrationTests.TaskTool_CancellationToken_GetTaskShowsWorkingBeforeCancel and the Windows Debug CI log for run 29271612002. Download the attached hang dumps and Sequence XML, then use dotnet-dump analyze and clrstack to inspect the blocked thread and determine whether the test was still executing. Done means the Windows Debug test leg completes deterministically without a host hang.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/csharp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
modelcontextprotocol/csharp-sdk#678 · 1 comment ·
-
enhancement needs confirmation P3 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/csharp-sdk#515 · 6 comments · 3 reactions ·
All issues in modelcontextprotocol/csharp-sdk
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·