Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Revert "ci(capture): name the oven-sh/bun#34069 spawnSync poisoning in a red shard's step summary"

time-attack2e7706e0938c
diff --git a/TODOS.md b/TODOS.md
index 675d570e97..31219b0752 100644
--- a/TODOS.md
+++ b/TODOS.md
@@ -1,9 +1,5 @@
# TODOS
-## CI runtime follow-ups (filed 2026-10-09, GBRA-64)
-
-- [ ] **P2 — Bump Bun when a release carries 13a98b0 (oven-sh/bun#44581); check the compare, not the version number.** **What:** Bun 1.4.0 and 1.4.2 carry oven-sh/bun#34069: a GC finalizer that runs while `Bun.spawnSync` waits drifts the runtime's private spawnSync loop for the life of the process, after which every synchronous child spawn with the matching poll count spins until the test deadline and returns empty output. In our 384-file single-process unit shards that is one `killed N dangling process` followed by nothing but timeouts for the rest of the shard (run 38004627376 attempt 1 on d4dc2d4d8, run 37971386009 on c12e14adf, both at the same point of shard 7). `scripts/capture-test-log.ts` names the signature `bun_spawnsync_poisoned` in the step summary; a rerun is the remedy. **Fix:** when a Bun release includes commit 13a98b0 (`https://github.com/oven-sh/bun/compare/bun-v<version>...13a98b0dbd136bcc5c98a8adfb53c909aa3183cc` reports `behind` or `identical`, never trust the version number alone), move the CI matrix and the documented install floor to it, then remove the signature's "no release" wording. **Effort:** S. **Priority:** P2.
-
## Content-repair lane follow-ups (filed 2026-10-09, GBRA-72, #6377)
Deferred by the plan (`docs/plans/2026-10-09-001-fix-content-repair-lane-6377-plan.md`, §2 B4 and §8 rows 4-7). The lane recommends a page merge and never executes one; interpretive frontmatter fixes stay consent-gated.
diff --git a/docs/TESTING.md b/docs/TESTING.md
index 2e5ce27035..0000168379 100644
--- a/docs/TESTING.md
+++ b/docs/TESTING.md
@@ -168,14 +168,7 @@ summary.
Failure reporting rides the same machinery. `scripts/capture-test-log.ts`
adds the last 50 failures to a red job's step summary (file, test, backend
arm, first error block and a `bun test … -t` reproduce command), falling back
-to the log tail when no `(fail)` line exists. It also names one runtime
-defect: a `killed N dangling process` line followed by nothing but timeouts in
-two or more files is `bun_spawnsync_poisoned` (oven-sh/bun#34069, fixed
-upstream by oven-sh/bun#44581 but in no Bun release yet): a GC finalizer that
-ran during an earlier `Bun.spawnSync` wait leaves every later synchronous
-child spawn in that process spinning until its deadline, so the rest of the
-shard says nothing about the tests and the job is rerun (TODOS.md tracks the
-Bun bump). `run-e2e.sh` kills and names any
+to the log tail when no `(fail)` line exists. `run-e2e.sh` kills and names any
process still running under a file's `HOME`, and fails that file by name when
its `HOME` cannot be removed. Coverage lanes write `executed-files.txt` on red
runs too; `lane-manifest.json` is written only on a green run.
diff --git a/scripts/capture-test-log.ts b/scripts/capture-test-log.ts
index 1fc2d5cfc4..d8dd58d53d 100644
--- a/scripts/capture-test-log.ts
+++ b/scripts/capture-test-log.ts
@@ -11,19 +11,7 @@ const MAX_PENDING_CHARS = 64 * 1024;
const SUMMARY_FAILURES = 50;
const ERROR_LINES = 15;
-export interface CapturedFailure { file: string; test: string; arm: string; error: string[]; timedOut?: boolean }
-
-/**
- * The log shape of oven-sh/bun#34069 (fixed upstream by oven-sh/bun#44581,
- * commit 13a98b0; in no Bun release as of 2026-10-09): a GC finalizer that
- * runs while `Bun.spawnSync` waits leaves the runtime's private spawnSync
- * loop with a drifted poll count for the life of the process, after which
- * every synchronous child spawn with the matching poll count spins until the
- * test deadline kills it (`killed N dangling process`) and returns empty
- * output. Once it starts, the rest of the shard's sync-spawning tests time
- * out one after another, in files that have nothing to do with each other.
- */
-export const BUN_SPAWNSYNC_POISONED = 'bun_spawnsync_poisoned';
+export interface CapturedFailure { file: string; test: string; arm: string; error: string[] }
/**
* Reads the live test output line by line and keeps the last 50 failures
@@ -40,26 +28,14 @@ export class FailureCollector {
private justFailed = false;
private block: string[] = [];
private tail: string[] = [];
- bunVersion = '';
- danglingKills = 0;
- private failuresSinceKill = 0;
- private timeoutsSinceKill = 0;
- private filesSinceKill = new Set<string>();
feed(raw: string): void {
const line = raw.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '');
this.tail.push(line);
if (this.tail.length > 20) this.tail.shift();
// Bun prints a timeout or hook note right below its (fail) line.
const last = this.failures[this.failures.length - 1];
- if (this.justFailed && last && /^\s+\^ /.test(line)) {
- last.error.push(line.trim());
- if (/timed out after/.test(line)) { last.timedOut = true; if (this.danglingKills) this.timeoutsSinceKill++; }
- return;
- }
+ if (this.justFailed && last && /^\s+\^ /.test(line)) { last.error.push(line.trim()); return; }
this.justFailed = false;
- const bun = /^bun test v(\S+)/.exec(line);
- if (bun) this.bunVersion = bun[1];
- if (/^killed \d+ dangling process(?:es)?$/.test(line)) this.danglingKills++;
const header = /^(?:::group::|##\[group\])?(\S.*\.test\.[cm]?[jt]sx?):$/.exec(line);
if (header) { this.file = header[1]; this.fileFailures = 0; this.block = []; return; }
if (/^=== .+ ===$/.test(line)) { this.arm = ''; this.fileFailures = 0; this.block = []; return; }
@@ -82,29 +58,9 @@ export class FailureCollector {
if (this.failures.length > SUMMARY_FAILURES) this.failures.shift();
this.total++;
this.fileFailures++;
- if (this.danglingKills) { this.failuresSinceKill++; this.filesSinceKill.add(this.file); }
this.justFailed = true;
this.block = [];
}
- /**
- * Whether the run carries the oven-sh/bun#34069 signature: a dangling child
- * killed at a test deadline, and from then on nothing but timeouts, at least
- * three of them, in at least two files. One hung test with a dangling child,
- * a run of timeouts with no killed child, or any non-timeout failure after
- * the kill is some other hang and is left for its own diagnosis.
- */
- poisoned(): boolean {
- return this.danglingKills > 0 && this.timeoutsSinceKill >= 3
- && this.timeoutsSinceKill === this.failuresSinceKill && this.filesSinceKill.size >= 2;
- }
- /** The one-paragraph verdict for a poisoned run, Markdown; empty otherwise. */
- poisonedNote(): string {
- if (!this.poisoned()) return '';
- const bun = this.bunVersion ? `Bun v${this.bunVersion}` : 'this Bun';
- return `> **${BUN_SPAWNSYNC_POISONED}**: \`killed N dangling process\` was followed by ${this.timeoutsSinceKill} timed-out tests across ${this.filesSinceKill.size} files and no other kind of failure. `
- + `That is the ${bun} runtime defect oven-sh/bun#34069: a GC finalizer that ran while an earlier \`Bun.spawnSync\` waited left the runtime's spawnSync loop with a drifted poll count, and from then on every synchronous child spawn (\`spawnSync\`, \`execSync\`, \`execFileSync\`) in this process spins until the test deadline and returns empty output. `
- + `The failures below say nothing about the tests; rerun the job. Fixed upstream by oven-sh/bun#44581 (commit 13a98b0), in no Bun release as of 2026-10-09; TODOS.md tracks the Bun bump.`;
- }
/** Markdown for $GITHUB_STEP_SUMMARY after a failed run. */
render(job: string, out: string, code: number): string {
const fence = (lines: string[]) => {
@@ -114,8 +70,6 @@ export class FailureCollector {
};
const esc = (v: string) => v.replace(/([|`*_<[\]\\])/g, '\\$1').replace(/@/g, '@\u200b');
const parts = [`### ${esc(job)}: exited ${code}`, '', `Full log: the job's uploaded timing log (${esc(out.split('/').pop() ?? out)}).`, ''];
- const poisoned = this.poisonedNote();
- if (poisoned) parts.push(poisoned, '');
if (!this.failures.length) {
parts.push('No `(fail)` lines were printed (setup, import or runner failure). Last log lines:', '', fence(this.tail), '');
return `${parts.join('\n')}\n`;
@@ -228,7 +182,6 @@ export async function captureTestLog(job: string, out: string, command: string[]
// Keep failed artifacts fail-closed when mined without GitHub run metadata.
if (code !== 0) {
await record(`##[error]captured command exited ${code}`);
- if (failures.poisoned()) console.error(`capture-test-log: ${BUN_SPAWNSYNC_POISONED}: ${failures.danglingKills} dangling child kill(s) followed only by timeouts; see oven-sh/bun#34069 (fixed by oven-sh/bun#44581). Rerun the job.`);
const summary = process.env.GITHUB_STEP_SUMMARY;
// B13: CI's --log-failed can come back empty; the step summary keeps the
// failing tests, their first error block and a repro command regardless.
diff --git a/test/scripts/capture-test-log.test.ts b/test/scripts/capture-test-log.test.ts
index 0ea3c4baf6..2c960d1623 100644
--- a/test/scripts/capture-test-log.test.ts
+++ b/test/scripts/capture-test-log.test.ts
@@ -3,7 +3,7 @@ import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'no
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
import { mineWeights } from '../../scripts/mine-shard-weights.ts';
-import { BUN_SPAWNSYNC_POISONED, FailureCollector, captureTestLog } from '../../scripts/capture-test-log.ts';
+import { captureTestLog } from '../../scripts/capture-test-log.ts';
const SCRIPT = resolve(import.meta.dir, '../../scripts/capture-test-log.ts');
const roots: string[] = [];
@@ -213,70 +213,3 @@ test('waits forever', async () => { await new Promise(() => {}); });`);
expect(existsSync(summary)).toBe(false);
});
});
-
-describe('bun_spawnsync_poisoned signature (oven-sh/bun#34069)', () => {
- // The shard-7 shape of run 38004627376 attempt 1 (d4dc2d4d8) and run 37971386009 (c12e14adf): a dangling child
- // killed at a deadline inside one file, then nothing but timeouts, in unrelated files, until the job budget ends.
- const feed = (lines: string[]) => { const c = new FailureCollector(); for (const line of lines) c.feed(line); return c; };
- const timeout = (test: string, ms: number) => [`(fail) ${test} [${ms}.00ms]`, ` ^ this test timed out after ${ms}ms.`];
- const poisonedRun = [
- 'bun test v1.4.2 (744846f84)',
- '##[group]test/persistence-git-publication.test.ts:',
- '(pass) literal Git pathspecs publish only the bracketed target and preserve the index [89.95ms]',
- 'killed 1 dangling process', 'killed 1 dangling process',
- ...timeout('unchanged replay, missing target and tracked deletion keep distinct outcomes', 60002),
- '##[group]test/voice-gate.test.ts:', '(pass) voice gate > default deny [1.20ms]',
- '##[group]test/persistence-preactivation-claim.test.ts:',
- 'killed 1 dangling process', ...timeout('#6122 pre-activation claim (pglite) > the dry run reports the claim', 120000),
- '##[group]test/scripts/merge-lcov.test.ts:',
- 'killed 1 dangling process', ...timeout('merge: DA summing across lanes > sums per-line hits', 60045),
- ];
-
- it('names the signature in the summary and the stderr line, with the Bun version and the upstream fix', () => {
- const c = feed(poisonedRun);
- expect(c.poisoned()).toBe(true);
- const summary = c.render('test (7)', '/tmp/unit.log', 1);
- expect(summary).toContain(`**${BUN_SPAWNSYNC_POISONED}**`);
- expect(summary).toContain('Bun v1.4.2');
- expect(summary).toContain('3 timed-out tests across 3 files');
- expect(summary).toContain('oven-sh/bun#34069');
- expect(summary).toContain('oven-sh/bun#44581');
- expect(summary).toContain('rerun the job');
- // The failing tests still follow, so the shard's own evidence is kept.
- expect(summary).toContain('#### test/scripts/merge-lcov.test.ts › merge: DA summing across lanes > sums per-line hits');
- });
-
- it('one hung test with a dangling child is not the signature', () => {
- const c = feed([
- 'bun test v1.4.2 (744846f84)', '##[group]test/a.test.ts:', 'killed 1 dangling process',
- ...timeout('git that outlives the probe timeout keeps Git effects unfinished', 60001),
- '##[group]test/b.test.ts:', '(pass) b > works [1.00ms]',
- ]);
- expect(c.poisoned()).toBe(false);
- expect(c.render('test (7)', '/tmp/unit.log', 1)).not.toContain(BUN_SPAWNSYNC_POISONED);
- });
-
- it('a run of timeouts with no killed child is a slow or wedged backend, not the signature', () => {
- const c = feed([
- 'bun test v1.4.2 (744846f84)',
- '##[group]test/a.test.ts:', ...timeout('a > first', 60000), ...timeout('a > second', 60000),
- '##[group]test/b.test.ts:', ...timeout('b > third', 60000), ...timeout('b > fourth', 60000),
- ]);
- expect(c.poisoned()).toBe(false);
- expect(c.render('test (7)', '/tmp/unit.log', 1)).not.toContain(BUN_SPAWNSYNC_POISONED);
- });
-
- it('a non-timeout failure after the kill, or timeouts confined to one file, is left for its own diagnosis', () => {
- const mixed = feed([
- ...poisonedRun,
- '##[group]test/c.test.ts:', 'error: expect(received).toBe(expected)', '(fail) c > asserts [2.00ms]',
- ]);
- expect(mixed.poisoned()).toBe(false);
- const oneFile = feed([
- 'bun test v1.4.2 (744846f84)', '##[group]test/a.test.ts:', 'killed 1 dangling process',
- ...timeout('a > one', 60000), ...timeout('a > two', 60000), ...timeout('a > three', 60000),
- ]);
- expect(oneFile.poisoned()).toBe(false);
- expect(oneFile.render('test (7)', '/tmp/unit.log', 1)).not.toContain(BUN_SPAWNSYNC_POISONED);
- });
-});