[GH-ISSUE #554] pixelforge test harness hangs instead of exiting when an assertion fails #283

Closed
opened 2026-10-20 17:26:06 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/554

Originally assigned to: @kolacheee on GitHub.

When an assertion fails in packages/pixelforge/test-brief.mjs, the node process can hang indefinitely instead of exiting non-zero. The assertion error is printed, and then the process just sits there — one observed instance ran past a 10-minute shell timeout. Green runs are unaffected: every passing run exits 0 promptly.

This was noticed during 0.12 development while doing fail-first red replays (temporarily reverting a production change to prove a new test catches it). The failure-path code involved is untouched by that branch, so this is believed to be pre-existing on staging — but the belief comes from reading the diff, not from a bisect.

Why it matters: the harness currently runs locally, where a human notices the hang and kills it. If it is ever wired into CI, a red run would stall the job until the CI timeout instead of failing fast — the worst possible failure mode for a regression harness, since a hang is easy to misread as infrastructure trouble rather than a failing test.

Repro sketch (against staging):

  1. Open packages/pixelforge/test-brief.mjs and break any assertion so it fails (e.g. flip an expected value in one of the world-shape lanes).
  2. node packages/pixelforge/test-brief.mjs
  3. Observe: the AssertionError prints, the process does not exit.

Not every failing assertion may reproduce it — the observed hangs were on lanes that had constructed sim/HUD state before failing, which also points at the likely mechanism.

Likely mechanism (hypothesis, unverified): a stray open handle keeps the event loop alive after the throw. The harness builds live objects (sim, HUD over the FakeNode shim) that arm timers/intervals; a passing lane presumably reaches its teardown, while a thrown assertion skips teardown and leaves the handle armed, so node never drains the loop. If that is right, the fix is small: either an unref() on harness-created timers, a try/finally teardown around lanes, or a top-level process.exitCode = 1; process.exit() in a final catch.

Suggested acceptance: any failing assertion exits non-zero within seconds; passing behavior unchanged.

Originally created by @kolacheee on GitHub (Aug 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/554 Originally assigned to: @kolacheee on GitHub. When an assertion fails in `packages/pixelforge/test-brief.mjs`, the node process can hang indefinitely instead of exiting non-zero. The assertion error is printed, and then the process just sits there — one observed instance ran past a 10-minute shell timeout. Green runs are unaffected: every passing run exits 0 promptly. This was noticed during 0.12 development while doing fail-first red replays (temporarily reverting a production change to prove a new test catches it). The failure-path code involved is untouched by that branch, so this is believed to be pre-existing on `staging` — but the belief comes from reading the diff, not from a bisect. **Why it matters:** the harness currently runs locally, where a human notices the hang and kills it. If it is ever wired into CI, a red run would stall the job until the CI timeout instead of failing fast — the worst possible failure mode for a regression harness, since a hang is easy to misread as infrastructure trouble rather than a failing test. **Repro sketch** (against `staging`): 1. Open `packages/pixelforge/test-brief.mjs` and break any assertion so it fails (e.g. flip an expected value in one of the world-shape lanes). 2. `node packages/pixelforge/test-brief.mjs` 3. Observe: the `AssertionError` prints, the process does not exit. Not every failing assertion may reproduce it — the observed hangs were on lanes that had constructed sim/HUD state before failing, which also points at the likely mechanism. **Likely mechanism (hypothesis, unverified):** a stray open handle keeps the event loop alive after the throw. The harness builds live objects (sim, HUD over the FakeNode shim) that arm timers/intervals; a passing lane presumably reaches its teardown, while a thrown assertion skips teardown and leaves the handle armed, so node never drains the loop. If that is right, the fix is small: either an `unref()` on harness-created timers, a `try/finally` teardown around lanes, or a top-level `process.exitCode = 1; process.exit()` in a final catch. **Suggested acceptance:** any failing assertion exits non-zero within seconds; passing behavior unchanged.
Author
Owner

@kolacheee commented on GitHub (Aug 24, 2026):

Status update from independent verification, correcting this issue's confidence level.

A second agent attempted to reproduce the hang as part of adversarially verifying the same 0.12 work, and could not — six attempts, all under a shell timeout:

  • Five different forced assertion failures on the 0.12 branch (including the exact revert the original observation came from — deleting the legacy pond registration) all printed their AssertionError and exited 1 promptly.
  • A forced assert.equal(1, 2, …) inserted at the equivalent location in a clean detached worktree at staging (45845e4b) exited 1 in ~2 seconds — so the "pre-existing on staging" claim in the issue body is also unconfirmed.

So the current evidence is: one observed hang (a red-replay run that sat past a 10-minute shell timeout during implementation) against six clean fast-fail reproductions of the same class, including the same lane. Possibilities that fit both observations: an environment-specific factor in the original run (shell/timeout interaction, another process holding something), a failure lane not among the six retried, or a genuine intermittent open-handle race that needs specific timer state to be armed at throw time.

Downgrading this from "known trap" to unconfirmed, needs a second observation. The CI concern in the body stands if the hang is real, and the acceptance bar ("any failing assertion exits non-zero within seconds") is cheap to assert regardless — a try/finally teardown or final-catch exit would make the question moot rather than requiring it to be settled. Fine to close as not-reproducible if nobody hits it again; if anyone does, please capture process._getActiveHandles() (or run with node --trace-exit) before killing it.

<!-- gh-comment-id:5399418925 --> @kolacheee commented on GitHub (Aug 24, 2026): Status update from independent verification, correcting this issue's confidence level. A second agent attempted to reproduce the hang as part of adversarially verifying the same 0.12 work, and **could not** — six attempts, all under a shell timeout: - Five different forced assertion failures on the 0.12 branch (including the *exact* revert the original observation came from — deleting the legacy pond registration) all printed their `AssertionError` and **exited 1 promptly**. - A forced `assert.equal(1, 2, …)` inserted at the equivalent location in a clean detached worktree at `staging` (`45845e4b`) exited **1 in ~2 seconds** — so the "pre-existing on staging" claim in the issue body is also unconfirmed. So the current evidence is: one observed hang (a red-replay run that sat past a 10-minute shell timeout during implementation) against six clean fast-fail reproductions of the same class, including the same lane. Possibilities that fit both observations: an environment-specific factor in the original run (shell/timeout interaction, another process holding something), a failure lane not among the six retried, or a genuine intermittent open-handle race that needs specific timer state to be armed at throw time. Downgrading this from "known trap" to **unconfirmed, needs a second observation**. The CI concern in the body stands *if* the hang is real, and the acceptance bar ("any failing assertion exits non-zero within seconds") is cheap to assert regardless — a `try/finally` teardown or final-catch exit would make the question moot rather than requiring it to be settled. Fine to close as not-reproducible if nobody hits it again; if anyone does, please capture `process._getActiveHandles()` (or run with `node --trace-exit`) before killing it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#283
No description provided.