Skip to content

Stabilize type-module rebuild test against subscription race - #9940

Merged
glen-84 merged 3 commits into
mainfrom
gai/stabilize-type-module-rebuild-test
Jun 17, 2026
Merged

glen-84 merged 3 commits into
mainfrom
gai/stabilize-type-module-rebuild-test

Conversation

@glen-84

@glen-84 glen-84 commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

  • RequestExecutorManagerTests.OnTypesChanged_Should_Not_Grow_CreateTypes_Calls_Exponentially_When_Type_Instance_Registered flaked on CI with a 30 s TaskCanceledException. A TriggerChange() only drives a rebuild while a change-monitor is subscribed, and the Dispose type module change monitor on failed executor creation #9902 fix disposes that monitor when a rebuild fails. The old loop fired each change then waited for the rebuild counter to bump, so under CI contention the next trigger could land after the failed rebuild had torn its monitor down, get dropped, and leave the wait to time out.
  • Reworked the test to invert the timing dependency so over-waiting is safe: fire one change while the initial monitor is reliably subscribed, deterministically wait for the failed rebuild to release its subscription (now observable via CountingTypeModule.SubscriberCount), then assert further changes are no-ops. A leaked subscription would instead fan out into additional rebuild attempts.

Test plan

  • Ran the test 8× locally on net10.0: passes (~700 ms each).
  • Temporarily reintroduced the leak (removed the dispose-on-failure in RequestExecutorManager) and confirmed the test still fails, then restored it, verifying the test remains a regression guard.

Copilot AI review requested due to automatic review settings June 17, 2026 13:59

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

Stabilizes a flaky RequestExecutorManager type-module rebuild regression test by removing a timing dependency on “change triggers must coincide with an active subscription”, and instead asserting behavior after the failed rebuild has disposed its change-monitor subscription.

Changes:

  • Reworked the test flow to trigger one rebuild deterministically, wait for the failed rebuild to release its subscription, then assert subsequent changes are no-ops.
  • Updated the test CountingTypeModule to implement ITypeModule directly and expose a SubscriberCount for observing subscription release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-code-quality

github-code-quality Bot commented Jun 17, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall coverage in the gai/stabilize-type-m... branch remains at 49%, unchanged from the main branch.

Show a code coverage summary of the most impacted files.
File main 4691dfa gai/stabilize-type-m... e197ad3 +/-
/home/runner/wo...sageRecorder.cs 100% 88% -12%
/home/runner/wo...gerMessage.g.cs 19% 15% -4%
/home/runner/wo...PromiseCache.cs 81% 78% -3%
/home/runner/wo...eiveEndpoint.cs 72% 69% -3%
/home/runner/wo...geDispatcher.cs 77% 75% -2%
/home/runner/wo...DefaultTopic.cs 90% 89% -1%
/home/runner/wo...nManagerBase.cs 83% 82% -1%
/home/runner/wo...qlConnection.cs 89% 92% +3%
/home/runner/wo...gerMessage.g.cs 15% 20% +5%
/home/runner/wo...toResetEvent.cs 68% 73% +5%

Updated June 17, 2026 15:24 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@glen-84
glen-84 merged commit 636294a into main Jun 17, 2026
145 checks passed
@glen-84
glen-84 deleted the gai/stabilize-type-module-rebuild-test branch June 17, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants