System.Threading.Tasks.Tests.AsyncProfilerTests.StateMachineAsync_CustomSyncContext_EmitsContextEventsAndCallstack failure: Expected CompleteStateMachineAsyncContext after Resume
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
## Build Information
Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1577792
Build error leg or test failing: System.Threading.Tasks.Tests.AsyncProfilerTests.StateMachineAsync_CustomSyncContext_EmitsContextEventsAndCallstack
Pull request: https://github.com/dotnet/runtime/pull/133052
## Error Message
**DO NOT USE JSON BELOW IF THIS IS A BUILD BREAK** otherwise build analysis will allow pull requests to merge that break the build worse. For a build break, do not use this issue form. Make a regular new issue.
Fill the error message using [step by step known issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Build%20Analysis/KnownIssueJsonStepByStep.md).
```json
{
"ErrorMessage": "Expected CompleteStateMachineAsyncContext after Resume",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}
```
### Known issue validation
**Build: :mag_right:** https://dev.azure.com/dnceng-public/public/_build/results?buildId=1577792
**Error message validated:** `[Expected CompleteStateMachineAsyncContext after Resume`]
**Result validation:** :white_check_mark: Known issue matched with the provided build.
**Validation performed at:** 9/2/2026 4:59:53 PM UTC
### Report
|Build|Repository|Test|Pull Request|
|---|---|---|---|
|[1577792](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1577792)|dotnet/runtime|[System.Threading.Tasks.Tests.AsyncProfilerTests.StateMachineAsync_CustomSyncContext_EmitsContextEventsAndCallstack](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1577792&view=ms.vss-test-web.build-test-results-tab&runId=43506662&resultId=199520)|dotnet/runtime#133052|
#### Summary
|24-Hour Hit Count|7-Day Hit Count|1-Month Count|
|---|---|---|
|0|0|1|
Contributor guide
Research direction
Start by running System.Threading.Tasks.Tests.AsyncProfilerTests.StateMachineAsync_CustomSyncContext_EmitsContextEventsAndCallstack and inspect the event sequence around Resume. Compare the observed profiler events with the expected CompleteStateMachineAsyncContext event; the work is done when the test passes consistently and preserves the expected callstack and context events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100