Skip to content

Deflake early-hints integration deployment on Windows - #2227

Merged
kriszyp merged 2 commits into
mainfrom
fix/early-hints-request-timeout
Aug 20, 2026
Merged

Deflake early-hints integration deployment on Windows#2227
kriszyp merged 2 commits into
mainfrom
fix/early-hints-request-timeout

Conversation

@kriszyp

@kriszyp kriszyp commented Aug 19, 2026

Copy link
Copy Markdown
Member

The Windows early-hints failure never reached /hints: the archived server log shows deploy_component entered npm install at 07:18:51 and produced no further output before undici's 300-second headers timeout. The Operations API holds response headers until deployment completes, so the accepted connection was waiting on the stalled child process, not an HTTP startup/readiness race; I could not reproduce or recover the deeper npm-internal cause from the one failed run.

This keeps the behavior fixture hermetic by replacing its unused source-toolchain install with node --version, then bounds every suite request with diagnostics that name the request and URL. Refs Windows Integration Testing #525; this is not the readiness/loopback race tracked by Integration test harness: startup-deadline and teardown/loopback-recycle races #1139.

For the human reviewer

  1. Bypass the fixture install: The packaged runtime imports only Harper and local files, so this endpoint suite skips the package's source-only development toolchain. Keeping the normal install would preserve packaging coverage but retain the observed external npm hang; this choice is easy to reverse.
  2. Keep the timeout helper local: The failing request is suite-specific and the shared @harperfast/integration-testing package cannot abort sendOperation, so this test posts deployment directly through a local helper. Extending the shared package would improve consistency but widen this deflake into a separate repository/API change.
  3. Use fixed timeout budgets: Ordinary requests abort after 10 seconds and deployment after 30 seconds. With installation reduced to a no-op, exceeding these limits indicates a stalled or severely degraded local deployment; the values remain easy to tune if Windows CI proves them too tight.

Verification

  • End-to-end route: extended the existing Component: early-hints integration suite; Linux passed all 12 tests three times against freshly built dist (7.6s, 7.7s, and 7.8s).
  • npm run build — passed.
  • npm run lint:required — passed.
  • PR CI — the relevant integration shard 3 passed on Windows Node.js 24 (6m36s) and Linux Node.js 24 (4m15s); unit matrices passed on Node.js 22, 24, and 26.
  • The one-night npm hang did not reproduce locally; the root-cause trace comes from the archived failed-run server log.

Complexity: easy

🤖 Generated by GPT-5 Codex.

Review-Coverage: authored=codex; ran=gemini; adjudicated=domain; declined=claude,cursor-grok,cursor-composer; rounds=2 @ e113c4c

Human-Review-Need: 3 (decisions: local-timeout-wrapper, bypass-fixture-install, per-request-timeout) @ e113c4c

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@kriszyp
kriszyp requested a review from ldt1996 August 19, 2026 18:56

@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 fetchWithTimeout helper function in the early-hints integration tests to replace standard fetch calls, preventing tests from hanging indefinitely. It also refactors the component deployment step to use this helper with a custom timeout and payload. The feedback suggests improving error diagnostics during deployment by reading the response as text before parsing it as JSON, which prevents a SyntaxError from masking the actual HTTP status code if the deployment fails with a non-JSON response.

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

claude Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found. The prior non-blocking suggestion (JSON parse ordering on deploy response diagnostics) has been addressed in e113c4c.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@kriszyp
kriszyp marked this pull request as ready for review August 20, 2026 00:11
@kriszyp
kriszyp merged commit 392f75b into main Aug 20, 2026
72 of 74 checks passed
@kriszyp
kriszyp deleted the fix/early-hints-request-timeout branch August 20, 2026 18:16
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