Skip to content

Fix race in Razor dispatcher test - #55515

Merged
davidwengier merged 1 commit into
dotnet:mainfrom
davidwengier:fix-razor-dispatcher-test-race
Jul 29, 2026
Merged

Fix race in Razor dispatcher test#55515
davidwengier merged 1 commit into
dotnet:mainfrom
davidwengier:fix-razor-dispatcher-test-race

Conversation

@davidwengier

Copy link
Copy Markdown
Member

Fixes #55494

At least I hope it does :)

Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2e8856e4-2e41-47cb-90c0-2afb0c5be773
Copilot AI review requested due to automatic review settings July 29, 2026 06:11
@davidwengier
davidwengier requested a review from a team as a code owner July 29, 2026 06:11
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an intermittent hang in the Razor tool test Dispatcher_ProcessSimultaneousConnections_HitsKeepAliveTimeout (#55494) by removing race-prone synchronization in the test and ensuring the test fails fast instead of hanging indefinitely.

Changes:

  • Add a bounded timeout to key awaits (readySource, allCompilationsComplete, and the dispatcher task) to prevent indefinite hangs.
  • Use TaskCreationOptions.RunContinuationsAsynchronously for the test’s TaskCompletionSource instances to avoid inline continuations causing deadlocks/starvation.
  • Make the compilation completion counter thread-safe via Interlocked.Increment.

@davidwengier
davidwengier merged commit 4fdbafe into dotnet:main Jul 29, 2026
22 checks passed
@davidwengier
davidwengier deleted the fix-razor-dispatcher-test-race branch July 29, 2026 20:59
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants