Repository navigation
Conversation
This branch has not been deployed
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.
Why
A backend could not run the decorators conformance suite (
dist/tests) for two server versions in parallel. The model test fetched its routes from API port 5010, a fixed value, so a second suite on the same machine failed to bind that port. AntelopeJS/mysql ran into this when running MySQL 8.4/9.7 and MariaDB 11.8/12.3 side by side, and now holds a lock so only one decorators run happens at a time. Parallel agent sessions on one machine collided on the port too.What
src/tests/helpers/api-port.tsaddsApiPort(). It readsDECORATORS_TEST_API_PORT, uses 5010 when the variable is unset or empty, and throws on anything that is not a port from 1 to 65535.src/tests/model.test.tsfetches fromhttp://localhost:${ApiPort()}.src/antelope.test.tsservesapion the same port.AGENTS.mdnames the variable.A backend that runs the suite sets
DECORATORS_TEST_API_PORTand serves itsapimodule on that same port.ApiPortis not a public subpath, so the backend reads the variable itself, for exampleNumber(process.env.DECORATORS_TEST_API_PORT ?? 5010). With the variable unset, nothing changes for current backends.Proof
Two copies of the repository, each built, each running
ajs module test . -f dist/tests/model.test.jsat the same time.Before, two copies of
origin/main. Both bind 5010. One run fails:After, two copies of this branch. One leaves the variable unset (5010), the other sets
DECORATORS_TEST_API_PORT=5011. Both pass:src/tests/api_port.test.tscovers the default, an explicit port, and the rejection ofabc,0,65536,50.1,5011and-1.pnpm run checks: