Repository navigation
Tests listen on ports the system chooses - #56
Merged
Merged
Conversation
Thirteen test files bound fixed ports (41873 to 41941, 14000 to 14060), which CI's parallel package suites and ephemeral client ports could take first; context.test.ts and the mcp Okta test even shared 41893. Each failure showed as a stray `fetch failed` in a package the change did not touch. Every server a test starts now binds port 0 through `serveOnFreePort` in @emulators/core, which holds the socket from the start and takes the emulator's handler once it is built for the bound address. The api tests ask createEmulator for port 0. URLs derived from the base address at collection time are read when called instead.
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.
Thirteen test files bound fixed ports (41873 to 41941, and 14000 to 14060 in the
emulateapi tests). CI's parallel package suites and ephemeral client ports could take them first, andcontext.test.tsand themcpOkta test even shared 41893. Each collision showed up as a strayfetch failedin a package the change under test did not touch.serveOnFreePort(new in@emulators/core, next toserve) binds port 0 and holds the socket from the start. It takes the emulator's handler once the emulator is built for the bound address, and answers 503 until then. Nothing else can take the port in between.mcpenterprise test now use it. Theemulateapi tests askcreateEmulatorfor port 0 and check the URL against the reported port.SUCCESS_URL,RETURN_URL, PlanetScale's MCP URL, Miro's challenge) are now read when called.Tests only, apart from the new export. The full suite passed three times in a row uncached (
turbo run test --force).