Skip to content

test(integration): retry early-hints deploy on transient npm/network errors#1511

Closed
dawsontoth wants to merge 2 commits into
claude/fix-ci-5of6from
claude/fix-ci-deploy-retry
Closed

test(integration): retry early-hints deploy on transient npm/network errors#1511
dawsontoth wants to merge 2 commits into
claude/fix-ci-5of6from
claude/fix-ci-deploy-retry

Conversation

@dawsontoth

Copy link
Copy Markdown
Contributor

Status: Draft — one of the focused follow-ups for the remaining shard-5/6 flakes. Stacked on #1504.

Flake

deploy_component runs the early-hints component's npm install, which on CI intermittently hits a transient registry error:

Failed to install dependencies for early-hints using npm default. Exit code: 1
npm error code ECONNRESET ... fetch https://registry.npmjs.org/@graphql-codegen%2ftypescript-operations: aborted

When that happens, the deploy fails, the readiness poll then 404s for 60s, and the whole early-hints suite fails in before. (Same registry flake also took out a v22 build.) This is genuinely transient — the correct response is to retry.

Fix

Retry the deploy up to 3× (with backoff) on transient install/network errors (ECONNRESET/ETIMEDOUT/EAI_AGAIN/fetch failed/Failed to install dependencies). On exhaustion, keep the existing behavior from #1504 (log the full error, fall through to the readiness poll). So a single transient ECONNRESET no longer fails the suite; only a sustained registry outage does.

This composes with the #1504 deploy guard: the retry handles the transient-npm case; the guard still handles the slow-restart HeadersTimeoutError case.

Validation

CI-only — transient network errors aren't reproducible on demand, and local restart_service is flaky. The retry path is exercised whenever the registry hiccups.

Scope note

This is the genuine-fix subset of the remaining flakes. Not addressed here (separate, by design): the drop_database ENOLCK (infra/engine — better as an investigation issue) and the terminology job-starvation timeout (band-aid over engine-side starvation). The HNSW reindex-tolerance fix is a separate PR stacked on #1505 (same file).

🤖 Generated with Claude Code

…errors

deploy_component runs the component's `npm install`, which intermittently hits
transient registry errors on CI (ECONNRESET / "Failed to install dependencies"),
failing the early-hints suite in `before`. Retry the deploy up to 3x on transient
install/network failures (with backoff) before giving up; on exhaustion, keep the
existing behavior (log the full error, rely on the readiness poll). A single
transient ECONNRESET no longer fails the suite; only a sustained outage does.

Stacked on #1504. CI-validated (transient network errors aren't reproducible on
demand; local restart_service is flaky).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a retry mechanism (up to 3 attempts) for component deployment in integration tests to handle transient network and installation errors. The review feedback suggests making the transient error detection more robust by checking both the message and code properties of the error object, as stringifying a plain object directly results in "[object Object]".

Comment thread integrationTests/components/early-hints.test.ts Outdated
@claude

claude Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

Address review feedback (#1511): check the error's message, code, nested cause
(message + code — undici fetch errors wrap the real ECONNRESET/timeout in
`.cause`), and the stringified error, rather than only `message ?? e`. A
code-only error, or one with an undefined message (where String(e) is
"[object Object]"), would otherwise not be recognized as transient and wouldn't
be retried.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dawsontoth dawsontoth closed this Jun 29, 2026
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.

1 participant