Skip to content

Fix flaky live tests: dispose race and port collisions - #69

Merged
Mpdreamz merged 2 commits into
mainfrom
fix/version-server-dispose-race
Dec 2, 2026
Merged

Mpdreamz merged 2 commits into
mainfrom
fix/version-server-dispose-race

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Two flakes in the live-test servers, both seen on ubuntu CI:

  1. Dispose race (failed Bump the nuget group with 5 updates #67 and Bump cross-spawn from 7.0.6 to 7.1.2 in /js/journeys #68): the serving task started the HttpListener on a pool thread; if DisposeAsync closed it first, Start() threw ObjectDisposedException into await _serving (AHostOutsideTheAllowListIsNotLookedAt). The task now returns when disposed before it started.
  2. Port collision (failed this PR once, AFormPostFailsTheStepAndNeverReachesTheServer): four servers each had a FreePort() that closed its probe before binding, so parallel servers (and VersionServer's delayed start) could get the same port. They now share TestPort.Free(), which never returns a port twice in-process.

Tested: new VersionServerTests (500 create/dispose cycles) fails without fix 1 and passes with it; full suite 529/529 and curb check clean locally. The port collision can't be forced locally, so fix 2 is untested beyond the full suite passing.

🤖 Generated with Claude Code

Mpdreamz and others added 2 commits December 2, 2026 12:36
DisposeAsync could close the listener before the serving task called Start(),
which then threw ObjectDisposedException into 'await _serving'. It made
AHostOutsideTheAllowListIsNotLookedAt flaky on CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Four servers each probed for a free port and closed the probe before binding, so
parallel tests (and VersionServer's delayed start) could be handed the same port,
failing with 'conflicts with an existing registration'.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Mpdreamz Mpdreamz changed the title Fix flaky VersionServer dispose race in live tests Fix flaky live tests: dispose race and port collisions Dec 2, 2026
@Mpdreamz Mpdreamz added the chore Internal change, no user-visible effect (patch) label Dec 2, 2026
@Mpdreamz
Mpdreamz merged commit a84767f into main Dec 2, 2026
12 of 13 checks passed
@Mpdreamz
Mpdreamz deleted the fix/version-server-dispose-race branch December 2, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Internal change, no user-visible effect (patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant