From e36382b8dd1939e6f7cc04b703e45010400e223b Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 26 May 2026 19:59:21 +0100 Subject: [PATCH 1/2] =?UTF-8?q?test(ci):=20probe=20=E2=80=94=20remove=20mo?= =?UTF-8?q?cha=20--exit=20on=20Windows=20backend=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Windows backend-tests workflow has invoked mocha with --exit since PR #7762, with the in-line comment: # --exit forces process.exit(failures) after the suite completes, # closing the post-suite event-loop drain window where Windows + # Node 24 hard-kills the process. Scoped to Windows so Linux/local # runs still surface real handle leaks via natural drain. That comment is a direct admission that a kill HAPPENS at the post-suite drain on Windows + Node 24, and --exit was added as a **mitigation that hides it**. The current silent-ELIFECYCLE flake fires MID-SUITE, but --exit is still in play after the dying test fires and may also be masking earlier signal. Probe: drop --exit on both Windows backend matrices. Expected outcomes on a passing run: - if Node still exits cleanly via natural drain → the original post-suite hard-kill bug from PR #7762 is no longer reproducible in current Node 24.x, and we've been carrying a workaround for nothing. - if a fresh hard-kill appears at post-suite drain → we now have a SECOND data point (different from the mid-suite flake) and can compare its signature to the mid-suite kill in artifacts. On a failing run (the mid-suite flake fires): - removing --exit may let mocha emit additional error reporting that --exit's process.exit() was suppressing. - or it may not change anything, which itself is a data point. This is a one-line probe on a separate branch from probe-flake-defender-eventlog-sidecar. Run in parallel; the two ask different questions. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/backend-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml index 08c8e58e240..b410cee7b2f 100644 --- a/.github/workflows/backend-tests.yml +++ b/.github/workflows/backend-tests.yml @@ -258,7 +258,7 @@ jobs: # Node 24 hard-kills the process. Scoped to Windows so Linux/local # runs still surface real handle leaks via natural drain. set +e - pnpm test -- --exit + pnpm test EXIT=$? set -e kill "$WATCHER_PID" 2>/dev/null || true @@ -392,7 +392,7 @@ jobs: # Node 24 hard-kills the process. Scoped to Windows so Linux/local # runs still surface real handle leaks via natural drain. set +e - pnpm test -- --exit + pnpm test EXIT=$? set -e kill "$WATCHER_PID" 2>/dev/null || true From fb175f73ee283b7b545855aacf4dd2a110690e21 Mon Sep 17 00:00:00 2001 From: John McLear Date: Tue, 26 May 2026 20:05:12 +0100 Subject: [PATCH 2/2] test(ci): skip the --exit guardrail vitest for this probe branch only --- .../specs/backend-tests-flake-mitigation.test.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/tests/backend-new/specs/backend-tests-flake-mitigation.test.ts b/src/tests/backend-new/specs/backend-tests-flake-mitigation.test.ts index 964e752cbfa..4aa99593192 100644 --- a/src/tests/backend-new/specs/backend-tests-flake-mitigation.test.ts +++ b/src/tests/backend-new/specs/backend-tests-flake-mitigation.test.ts @@ -45,14 +45,17 @@ describe('backend-tests flake mitigation (PR #7748)', () => { .toBe(runStepCount); }); - it('Windows backend-test steps invoke pnpm test with --exit', () => { - // --exit is the Windows-only mitigation. Linux still runs natural-drain - // so leaked-handle regressions stay visible there. + it.skip('Windows backend-test steps invoke pnpm test with --exit (PROBE: temporarily disabled)', () => { + // PROBE branch only — see PR #7856. The original assertion enforced + // that the post-suite-drain mitigation from PR #7748 stays in place. + // This probe deliberately drops --exit to see whether (a) the original + // post-suite hard-kill bug still reproduces on current Node 24.x, or + // (b) --exit was also masking signal from the mid-suite silent flake. + // The .skip is REQUIRED for the probe branch to run; if this is in a + // PR targeted at develop, revert it before merge. const exitCount = (workflow.match(/pnpm test -- --exit/g) || []).length; expect(exitCount, 'Windows × 2 jobs must pass --exit to pnpm test') .toBe(2); - // Negative check: Linux jobs must NOT use --exit so handle-leak - // detection stays alive on the natural-drain platforms. expect(workflow.includes('runs-on: ubuntu-latest'), 'workflow no longer has any Linux jobs (sanity check)').toBe(true); });