Skip to content

fix(ci): make nightly green — four independent causes behind #376 - #378

Merged
AminDhouib merged 4 commits into
devfrom
fix/nightly-red-2026-09
Sep 9, 2026
Merged

fix(ci): make nightly green — four independent causes behind #376#378
AminDhouib merged 4 commits into
devfrom
fix/nightly-red-2026-09

Conversation

@AminDhouib

Copy link
Copy Markdown
Member

Summary

Nightly has failed on every run since 2026-08-02 (#376). The failing job rotated night to night, which hid that there are four independent causes. Each is fixed here with the evidence that pins it.

  • Landing feedback e2e (8 of the last 9 nights) — the "AI thumbs events landed" poll timed out at 90 s, but PostHog's own created_at shows both events ingested 1-2 s after capture on every failing night. The Query API's default refresh mode serves a cached result for identical query text until it goes stale, and expect.poll re-sends byte-identical text, so the first empty answer was replayed for the whole poll. Fix: refresh: 'force_blocking' on every query, plus a log line for transient non-OK statuses.
  • Full E2E + a11y (2 nights)EADDRINUSE :::53062 then "presign harness never bound". The real-MinIO resume specs listened on 53061/53062, inside Linux's ephemeral source-port range (32768-60999), so the runner's own outbound connections could hold the port. Fix: 31061/31062, below the range.
  • Cloud-drive live (6 nights) — the one-drive download case hit vitest's 5 s default timeout while the other 24 assertions passed. Fix: a 30 s test/hook timeout for a suite that talks to a production cloud API; a broken provider still goes red, later.
  • Package smoke (3 nights, and PR chore: sync dev with master (CI artifact storage) #377's E2E Status Check right now)libheif-bundle is 1939.4 KiB, above 1600.0 KiB. libheif-js 1.23.2 shipped 2026-09-05 and the smoke consumer installs fresh from core's ^1.19.8 range with no lockfile, exactly as a real consumer does. Fix: re-base the OPT-IN chunk budget 1600→2100 KiB (core's mandatory path stays guarded by the entry budget and .size-limit.json).

Refs #376 — the landing project runs only in nightly, so #376 closes after the next green nightly rather than on merge.

Test Plan

  • prettier --check on every changed file (exit 0)
  • @useupup/e2e-test typecheck (exit 0)
  • pnpm run test:quality (exit 0)
  • pre-commit unit suites (core/react/server) green; pre-push typecheck + lint + knip green
  • Smoke-Packages on this PR passes with the re-based budget
  • first nightly after merge is green (or workflow_dispatch nightly.yml on dev)

Follow-up not covered here

The HEIC step was only build-checked against libheif-js 1.23.x; a live HEIC conversion against the bumped dependency is still worth a manual check.

The package-smoke consumer installs fresh from core's `libheif-js: ^1.19.8`
with no lockfile - deliberately, so it resolves the way a real consumer would.
libheif-js 1.23.2 published 2026-09-05T19:18Z and grew the opt-in HEIC
emscripten bundle from 1,459 kB to 1939.4 KiB, so the very next nightly
(2026-09-06) went red on a budget no repo change had touched, and every
nightly since has died the same way:

  Error: Consumer JS asset libheif-bundle-DeNY_ZvL.js is 1939.4 KiB, above 1600.0 KiB

The same job gates PRs through e2e.yml. No PR ran between the upstream publish
and 2026-09-09, which is the only reason PRs still looked green; today's run
fails on this job and nothing else.

This ceiling guards the OPT-IN chunk, which is upstream WASM we neither author
nor can shrink. Core's mandatory path keeps its own tighter guards
(consumerEntryChunkBudget, .size-limit.json), so re-basing here does not weaken
them. Vite's chunkSizeWarningLimit moves in step.
Identical failure on the 2026-08-26, 09-02, 09-04, 09-05 and 09-06 nightlies -
the same single test every time, with the other 24 assertions green:

  FAIL tests/integration/drive-clients-live.integration.test.ts
       > drive-clients live - one-drive
       > a client can download each fixture and the bytes are byte-exact ...
  Error: Test timed out in 5000ms.

Every test in this file is network-bound against a production cloud API, and
the download case costs a folder listing plus a redirect-followed fetch and a
full stream drain per fixture. Vitest's 5 s default is a unit-test budget that
nobody chose for this suite, so the gate was reporting the clock rather than
the code.

What the suite actually gates is byte-integrity - sha256 against the committed
fixture - and never latency, so a 30 s ceiling loses nothing: a provider that
is down, or a token that is broken, still goes RED. hookTimeout moves with it
because beforeAll's OAuth mint is the same kind of round trip.

vi.setConfig applies file-wide and keeps the diff at 13 lines; restructuring
the describe call to take a timeout argument would have re-indented the whole
suite body for no additional guarantee. Verified rather than assumed: a
throwaway spec sleeping 7 s passes under vi.setConfig({ testTimeout: 20_000 })
where the 5 s default fails it.
The 2026-09-06 nightly's Full E2E job died here:

  Error: listen EADDRINUSE: address already in use :::53062
  Error: presign harness never bound http://localhost:53062 - is @useupup/server built?

Linux draws ephemeral source ports from 32768-60999, so 53061 and 53062 - the
fixed LISTEN ports the two real-MinIO resume specs own - sit inside the window
the kernel hands out for the runner's own outbound connections. Losing that
race costs the whole job: the child dies immediately and the harness poll then
burns its full 60 s against a port nothing is bound to.

Moved to 31061 and 31062, below the range, and recorded the rule on
startPresignHarness so the next spec that needs a harness picks a safe port
instead of the next number up.

The rest of the 5306x family is deliberately untouched: :53060 is the
cross-framework gate's harness and sits inside the OAuth clients' registered
redirect range (53050-53060), so it is pinned by external registration, not by
convention.
… poll

The nightly "AI thumbs events landed" case failed 8 of the last 9 nights
with a 90 s poll timeout, while PostHog's own `created_at` shows both
`ai_response_rated` and `ai_response_feedback_comment` ingested 1-2 s
after capture on every one of those nights (run ids e2e:1788769131541-…,
e2e:1788594082953-…, e2e:1788509140023-…, …). The data was there for the
whole poll; the poll never saw it.

Cause: the Query API's default execution mode ("blocking") serves a cached
result whenever one exists for identical query text and is not yet stale,
and every iteration of `expect.poll` sends byte-identical text. A first
poll that lands before the events are queryable caches an empty result and
the remaining 90 s replay that cache. The support case right before it
passes because its events are already minutes old by the time it polls.

Send `refresh: 'force_blocking'` so every poll recalculates, and log a
transient non-OK status so a future timeout is never a silent mystery.
@codesandbox

codesandbox Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

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