test: use os-assigned ports for test servers#97
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
docs: recommend dot reporter for test runs — AGENTS.md Testing section now says to use --reporter=dot when running all tests or any run that doesn't need a test's console output (detail printed only for failures); drop it only when debugging with logs. Companion to udibo/udibo#59. |
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.
Summary
Test servers no longer bind fixed port 8100, so multiple test runners (e.g. parallel AI agents) can run simultaneously without "address already in use" failures. Note that leaving
DENO_SERVE_ADDRESSunset is not an option:Deno.servethen defaults to fixed port 8000, which would collide with the dev server instead.Changes
main.test.tstests (example, 4 templates, blog tutorial) now injectDENO_SERVE_ADDRESS=tcp:127.0.0.1:0into the spawned child so the OS assigns a free port, parse the actual URL from the child'sListening online, and fetch that URL instead of a hardcodedhttp://localhost:8100/. The Windows-specific exact-line assertion existed only to check the fixed port and is removed.DENO_SERVE_ADDRESSfrom all.env.testfiles.docs/getting-started.md,docs/tutorials/blog.md(embedded test snippet matches the real file), template/example/tutorial READMEs, and the stale port example insrc/utils/global-jsdom.ts(its 8000 fallback behavior is unchanged).Testing
All project suites pass: src (19 tests / 266 steps), example, all 4 templates, and the blog tutorial. Parallel-safety was proven directly: two concurrent runs of the same spawn test bound different OS-assigned ports (42695 / 34611) and both passed; nothing is left listening on 8100 afterward.
🤖 Generated with Claude Code