Skip to content

test(lease): bound persistence-lease tests so a hanging mutant fails instead of wedging the run - #56

Merged
willytop8 merged 3 commits into
mainfrom
wr/lease-test-process-hang
Aug 7, 2026
Merged

test(lease): bound persistence-lease tests so a hanging mutant fails instead of wedging the run#56
willytop8 merged 3 commits into
mainfrom
wr/lease-test-process-hang

Conversation

@willytop8

Copy link
Copy Markdown
Owner

Every test in test/persistence-lease.test.js waited on real filesystem locking with no time bound. Several mutation-contract mutants remove the guard that lets one of those waits finish, so the test does not fail — it hangs the whole run until CI's job timeout, reporting nothing about which mutant caused it.

Found by running npm run test:mutation on Node 24, which had never been done: CI runs the mutation contract only in the Node 22 Quality and package contracts job. On Node 24 it wedged at mutant 28, and after that at mutant 36 in a different test.

  • File-local test wrapper applying a 30s timeout to all 31 tests. Node 18 has no --test-timeout, so it cannot be a CLI flag. Generous on purpose: normal runs finish in milliseconds.
  • Early-exit race on the child-process test, so a holder that dies before signalling READY fails immediately with the child's stderr instead of blocking forever.
  • t.after() reaps the child: finally does not run when a test times out, and a surviving child keeps its stdio pipes — and the whole runner process — alive after the suite ends.

Test-only. No shipped file changes.

Not a product bug. The lease code fails closed correctly and immediately (ERR_GOAL_PERSISTENCE_LEASE_PATH); only the test harness hung.

Checks

Node suite mutation
18.20.8 356/356 67/67
20.20.2 356/356 67/67
22.22.3 356/356 67/67
24.19.0 356/356 67/67 — completes for the first time

@willytop8
willytop8 merged commit 7b0b8bf into main Aug 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant