Skip to content

npm e2e: log the mock upstream's requests one whole line at a time - #469

Merged
schmitch merged 1 commit into
mainfrom
claude/npm-e2e-log-race
Oct 24, 2026
Merged

schmitch merged 1 commit into
mainfrom
claude/npm-e2e-log-race

Conversation

@schmitch

Copy link
Copy Markdown
Member

npm-e2e failed 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.sh handles requests on threads of their own (ThreadingHTTPServer), and each handler logged with print(). print() writes the text and the newline separately. When an install fetches two tarballs at once, their two lines can run together:

GET /e2e-dep/-/e2e-dep-2.0.0.tgz auth=FalseGET /e2e-public/-/e2e-public-1.1.0.tgz auth=False

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.md it 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.sh with the change passes locally, and every line of the upstream log is whole.

Generated by Claude Code

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
@schmitch
schmitch added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit c7650b7 Oct 24, 2026
18 checks passed
@schmitch
schmitch deleted the claude/npm-e2e-log-race branch October 24, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants