Repository navigation
test: Give each test run its own port and queue - #26479
Merged
Merged
Conversation
…ites `MongoMemoryServer` looks for a free port and starts `mongod` on it afterwards. Another process can take the port in between, which failed 11 suites with "Port already in use". Each suite now has its own port below the ephemeral range, where the OS does not assign ports. The hapi, koa, and dataloader scenarios listened on a fixed port, which the child process of the previous run can still hold. They now listen on port 0 and send the real port to the runner.
`startFakeIngests` closed a listener to get a port that refuses connections. The OS can give that port to the next listener, for example the app under test, and the tunnel then forwards to the app itself. The port is now the local port of an open connection, which has no listener and which the OS gives to no one.
The queues are exclusive, and the broker can still hold the lock of the previous run when the next run declares the same queue name (RESOURCE-LOCKED). The broker now names the queue of the topic scenario, and the callback scenario gets a unique name from the test.
Contributor
size-limit report 📦Compared: 3ae1569 (PR test merge using develop at 524bd26) Against: 524bd26 (develop) · base run #66453 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 60 successful. See the run.
Successful checks
|
s1gr1d
commented
Nov 17, 2026
| const server = Hapi.server({ | ||
| host: 'localhost', | ||
| port, | ||
| port: 0, |
Member
Author
There was a problem hiding this comment.
Port 0 tells it to pick a free port
s1gr1d
marked this pull request as ready for review
November 17, 2026 13:44
javascript-sdk-gitflow
Bot
requested review from
JPeer264,
andreiborza and
isaacs
November 17, 2026 13:45
nicohrubec
approved these changes
Nov 17, 2026
andreiborza
approved these changes
Nov 17, 2026
51 tasks done
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.
What
MongoMemoryServeron its own fixed port.Why
These tests failed in CI because two processes wanted the same port or queue.
Port 0 is only safe when the process that asks for the port also listens on it.
MongoMemoryServerasks for a free port and startsmongodon it in a second step, and another process can take the port in between ("Port already in use"). So the Mongo suites use fixed ports below the range that the OS assigns from.Ref #26477