Repository navigation
Fix flaky live tests: dispose race and port collisions - #69
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two flakes in the live-test servers, both seen on ubuntu CI:
HttpListeneron a pool thread; ifDisposeAsyncclosed it first,Start()threwObjectDisposedExceptionintoawait _serving(AHostOutsideTheAllowListIsNotLookedAt). The task now returns when disposed before it started.AFormPostFailsTheStepAndNeverReachesTheServer): four servers each had aFreePort()that closed its probe before binding, so parallel servers (andVersionServer's delayed start) could get the same port. They now shareTestPort.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 andcurb checkclean locally. The port collision can't be forced locally, so fix 2 is untested beyond the full suite passing.🤖 Generated with Claude Code