From d69f211629e2fcdb24ab6fb6105982f2ea3830e8 Mon Sep 17 00:00:00 2001 From: Time Attakc <89218912+time-attack@users.noreply.github.com> Date: Wed, 22 Jul 2026 13:41:32 -0700 Subject: [PATCH] fix(ci): delta-assert reporter leak test + raise shard timeout to 22min (#3231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The signal-handler test asserted an absolute liveReporters===0 on a module-global set, so any other test file in the shard holding a live reporter flaked it — it red-flagged ~12 unrelated PR runs and one master push in two days, purely as a function of shard composition. The delta form pins the same claim (50 reporter lifecycles leak nothing). The 15-minute shard timeout cancelled 13 fully-passing runs under parallel PR load (PGLite WASM cold-starts stretch shards); the test-status gate then reported the cancellations as failures. Co-authored-by: Garry Tan Co-authored-by: Claude Fable 5 --- .github/workflows/test.yml | 6 +++++- test/progress.test.ts | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a80e4b77..db63724f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -206,7 +206,11 @@ jobs: needs: cache-check if: needs.cache-check.outputs.hit != 'true' runs-on: ubuntu-latest - timeout-minutes: 15 + # 22, not 15: under parallel PR load the PGLite WASM cold-starts stretch a + # shard past 15 min while every test is still passing — the timeout then + # cancels the job and the test-status gate reads it as a failure. 13 runs + # died this way on 2026-07-21/22 alone. + timeout-minutes: 22 strategy: fail-fast: false matrix: diff --git a/test/progress.test.ts b/test/progress.test.ts index 0e70e0d6f..7f266d770 100644 --- a/test/progress.test.ts +++ b/test/progress.test.ts @@ -218,15 +218,21 @@ describe('progress reporter', () => { test('only one process-level signal handler installed across many reporters', () => { // Baseline: one handler already installed by prior tests in this file. const installedBefore = __signalHandlerInstalledForTest(); + // liveReporters is module-global, so a reporter left running by ANOTHER + // test file in the same shard shows up here. Assert the DELTA (these 50 + // lifecycles leak nothing) instead of an absolute zero — the absolute + // form flaked whenever shard composition changed and an unrelated file + // held a live reporter across this test. + const liveBefore = __liveReporterCountForTest(); const { stream } = sink(false); for (let i = 0; i < 50; i++) { const p = createProgress({ mode: 'json', stream, minIntervalMs: 0, minItems: 1 }); p.start(`phase_${i}`, 1); p.finish(); } - // After 50 reporter lifecycles, still exactly one handler and zero leaked live entries. + // After 50 reporter lifecycles, still exactly one handler and no new live entries. expect(__signalHandlerInstalledForTest()).toBe(installedBefore || true); - expect(__liveReporterCountForTest()).toBe(0); + expect(__liveReporterCountForTest()).toBe(liveBefore); }); test('startHeartbeat() fires heartbeats and stop() clears', async () => {