Repository navigation
npm e2e: log the mock upstream's requests one whole line at a time - #469
Merged
Merged
Conversation
The mock upstream registry handles requests on threads of their own
(ThreadingHTTPServer), and each logged with print(), which writes the
text and the newline separately. Two requests at once, such as the two
tarballs an install fetches in parallel, could then run together on
one line ("GET /e2e-dep/-/e2e-dep-2.0.0.tgz auth=FalseGET
/e2e-public/-/e2e-public-1.1.0.tgz auth=False"), and the check that
the upstream served the tarball once counted the line it starts with
GET /e2e-public: none, so it failed. The handlers now write each line
whole, under a lock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CxwRK8xYPsMDBiMkySxcHf
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.
npm-e2efailed on #462 at "the upstream served the tarball more than once", but the upstream had served it once. The mock upstream registry in.github/scripts/npm-e2e.shhandles requests on threads of their own (ThreadingHTTPServer), and each handler logged withprint().print()writes the text and the newline separately. When an install fetches two tarballs at once, their two lines can run together:The check counts the lines that start with
GET /e2e-public/-/e2e-public-1.1.0.tgz, finds none, and fails. Any pull request can hit this, depending on timing (CI run: https://github.com/forgepkg/forge/actions/runs/40108663020/job/120915592922).Change
The handlers log through
log(), which writes each line whole, under a lock. The script changes in nothing else, and Forge's code doesn't change.No issue asks for this, so per
AGENTS.mdit goes in a pull request of its own rather than into #462. No changelog fragment, since nothing changes for anyone running Forge.Checks
npm-e2e.shwith the change passes locally, and every line of the upstream log is whole.Generated by Claude Code