Skip to content

chore: fix e2e ERR_STREAM_PREMATURE_CLOSE and flaky ARM Alpine setup#2378

Merged
ava-silver merged 1 commit into
masterfrom
ava.silver/chore/pin-alpine-ci-to-node-22-to-fix-e2e-premature-close
Jun 24, 2026
Merged

chore: fix e2e ERR_STREAM_PREMATURE_CLOSE and flaky ARM Alpine setup#2378
ava-silver merged 1 commit into
masterfrom
ava.silver/chore/pin-alpine-ci-to-node-22-to-fix-e2e-premature-close

Conversation

@ava-silver

@ava-silver ava-silver commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What and why?

Two CI failures on the Alpine and serverless e2e jobs, both pre-existing on master and unrelated to feature work:

  1. ERR_STREAM_PREMATURE_CLOSE on every Datadog API call from the e2e checkers. The @datadog/datadog-api-client defaults to cross-fetch (node-fetch v2), which intermittently aborts the response stream against the Datadog API on some platforms (notably Alpine/musl). It is not tied to a single Node major -- it reproduced on Node 22.23 and 24.17 in Alpine, while the glibc ubuntu jobs on Node 22.19 stayed green.
  2. Flaky Test standalone binary in ARM Alpine setup. jirutka/setup-alpine downloads the aarch64 apk.static with a single 10s-timeout curl from the gitlab mirror, which is unreliable from arm64 runners (curl: (28) Failed to connect ... Timeout).

How?

  1. Route the e2e api-client through Node's native fetch (undici), which handles connection close gracefully. Added a createE2EConfiguration() helper that passes fetch: globalThis.fetch as a top-level config param (the client overwrites httpApi.fetch with conf.fetch during createConfiguration, so setting it on the instance is ignored). Wired into junit-upload-checker.ts and telemetry-checker.ts.
  2. Pre-fetch the aarch64 apk.static with retries into the path setup-alpine caches ($RUNNER_TEMP/apk) before the Setup Alpine step. The action verifies the cached file's sha256 and skips its own flaky download.

Verified in CI: Test standalone binary in Alpine and the End-to-end test the package matrix now pass with the fetch fix.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jun 24, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a2045be | Docs | Datadog PR Page | Give us feedback!

@ava-silver
ava-silver force-pushed the ava.silver/chore/pin-alpine-ci-to-node-22-to-fix-e2e-premature-close branch from 0911173 to 8ec26ed Compare June 24, 2026 18:29
@ava-silver ava-silver added chores Related to the CI or developer experience datadog-ci For PRs spanning multiple commands, and repo-wide changes labels Jun 24, 2026 — with Graphite App
@ava-silver ava-silver changed the title chore: pin alpine ci to node 22 to fix e2e premature close chore: route e2e api-client through native fetch to fix ERR_STREAM_PREMATURE_CLOSE Jun 24, 2026
@ava-silver
ava-silver force-pushed the ava.silver/chore/pin-alpine-ci-to-node-22-to-fix-e2e-premature-close branch from 8ec26ed to ab3e06c Compare June 24, 2026 19:12
@ava-silver
ava-silver marked this pull request as ready for review June 24, 2026 19:40
@ava-silver
ava-silver requested review from a team as code owners June 24, 2026 19:40
@ava-silver
ava-silver requested a review from avangelillo June 24, 2026 19:40
@ava-silver
ava-silver force-pushed the ava.silver/chore/pin-alpine-ci-to-node-22-to-fix-e2e-premature-close branch from ab3e06c to a2045be Compare June 24, 2026 20:06
@ava-silver ava-silver changed the title chore: route e2e api-client through native fetch to fix ERR_STREAM_PREMATURE_CLOSE chore: fix e2e ERR_STREAM_PREMATURE_CLOSE and flaky ARM Alpine setup Jun 24, 2026
@ava-silver
ava-silver merged commit f13c44c into master Jun 24, 2026
34 checks passed
@ava-silver
ava-silver deleted the ava.silver/chore/pin-alpine-ci-to-node-22-to-fix-e2e-premature-close branch June 24, 2026 20:55
@ava-silver ava-silver mentioned this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chores Related to the CI or developer experience datadog-ci For PRs spanning multiple commands, and repo-wide changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants