Repository navigation
ci: bound the upgrade smoke's npm and HTTP steps so a stalled registry fails it, not the job - #3582
Conversation
…y fails it, not the job The merge-queue run for #3552 on ec85d3e hung after its last printed task until full-pr's 15-minute limit. The task still running was //#smoke-upgrade (normally about 11 s): turbo prints a task's group only when it ends, so the log showed nothing of it. Its npm calls had no deadline of their own, and npm's (fetch-timeout 5 min, 2 retries) outlast the job; waitForPublished turned a failed `npm view` into 20-second polling for up to 15 minutes. Run each npm call with a deadline and a bounded number of attempts, keep waitForPublished's polling for npm's answer that the version is missing (E404), and give the readyz poll and the API requests a per-request timeout. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVbPErbwzmWcPYv1gS
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
The smoke script can exceed CI’s 900-second limit before server startup, causing cancellation before grouped failure diagnostics are reported.
1 open issue
What changed in this PR
Adds deadlines and retries to the server smoke scripts so stalled npm or HTTP requests fail with diagnostics rather than consuming the CI job’s timeout.
Changes:
- Bounds npm attempts and retries.
- Limits publication polling to missing-package responses.
- Adds readiness and API request timeouts.
| File | Description |
|---|---|
scripts/smoke-upgrade.mjs |
Uses bounded npm lookups and API request timeouts. |
scripts/smoke-server.mjs |
Adds npm deadlines, selective publication polling, and readiness request timeouts. |
Review effort: Balanced
| const installed = await npmWithDeadline( | ||
| ["install", "--prefix", dir, "--no-audit", "--no-fund", `@zitadel/server@${version}`], | ||
| { cwd: dir }, | ||
| { cwd: dir, timeoutMs: 180_000, attempts: 2 }, |
Three lookups at three attempts of 60 s and an install at two of 180 s could add up to more than the 15 minutes full-pr allows, so a registry that stalls late would still end in a cancelled job without the smoke's output. The lookups get 30 s and the install 120 s: under ten minutes at worst, and still far above the second or so each takes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0137eGmVSt2DgYJj2CjZbi1U

Context
full-pr's 15-minute limit cancelled it at 17:12:23 UTC.Summary
What the run was waiting on
@zitadel/e2e#journey:preexisting-nuxt, ended at 17:00:56. With grouped log order, turbo prints a task only when it ends, so a task that never ends prints nothing.TURBO_SCM_BASE=348f144… turbo run <ci list> --affected --dry=jsonon ec85d3e) and diffed it against the printed groups. Exactly one task with a command is missing://#smoke-upgrade. It depends on@zitadel/server#build, which finished at 16:59:01.pnpmwith twoshchildren: the task's process tree.--summarize: those come after the last task, and one task never finished.Why it could hang for the whole job
@zitadel/serverfrom public npm (npm view, thennpm install) with no deadline of its own. npm's limits (fetch-timeout5 min,fetch-retries2, 10–60 s backoff) outlast the job: against a registry that accepts a connection and sends nothing,npm viewwas still waiting after 90 s.waitForPublishedswallowed everynpm viewerror as "not published yet" and polled every 20 s for up to 15 minutes, which is also the job's limit.registry.npmjs.orgstreams (see the journey diagnostics PR). A registry stall is the likely trigger. The task's output was never printed, so I cannot prove which npm step it was.The change (
scripts/smoke-server.mjs,scripts/smoke-upgrade.mjs)npmWithDeadlineruns npm with a deadline and a bounded number of attempts:npm view: 60 s per attempt, 3 attempts.npm install: 180 s per attempt, 2 attempts.waitForPublishedkeeps polling only while npm answersE404, the nightly's "platform package not published yet" case. Any other npm failure ends the smoke after its attempts./readyzpoll gets a 5 s timeout per request, and the smoke's API requests 60 s.How this rules the hang out
E404: 3 × (60 s + 5 s) for eachnpm view, 2 × 180 s for the install, then the existing 120 sstartServer/migratebounds. That is a few minutes, and it ends in a failure that prints what stalled.E404for the platform package of a release published minutes earlier, which the nightly needs. In CI,latesthas been published for days.Validation
turbo run @zitadel/server#build), then rannode scripts/smoke-upgrade.mjs: passed in 5 s (0.10.0 wrote schema 47; the build migrated it to 51 and read the user back).node scripts/smoke-server.mjs --version 0.10.0: passed.npmWithDeadline(["view", …])against a local TCP server that never answers (3 s deadline, 2 attempts) failed after 6.5 s withran longer than 3s (attempt 2 of 2). Plainnpm viewagainst the same server was still waiting at 90 s.npm viewof a missing version (@zitadel/server@99.0.0) and of a missing package both answerE404;@zitadel/server@0.10.0answers0.10.0.biome checkon both files: clean.full-prjob itself.Release notes / changeset
Notes
actions/checkout, GitHub's git transport, which no limit that still catches a real hang would absorb.Generated by Claude Code