Skip to content

Commit d23e319

Browse files
committed
test(prepush): accept either tail notice in the surviving-leg row
A slow stop kill can use up the whole tail before the hung node fork starts, so the cap prints the skipped notice instead of the left-no-time notice; both mean the tail deadline passed, and that row's subject is the surviving leg being ended, so it now accepts either.
1 parent df4d3cd commit d23e319

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎tests/prepush_cap_smoke.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,9 @@ describe('the hard stop ends the legs of a real hook run', () => {
665665
expect(pid).toContain(`left running: ${readFileSync(path.join(stubs, 'unkillable'), 'utf8').trim()}`)
666666
}, true)
667667

668+
// Used only by the surviving-leg row below: either notice proves the tail deadline passed before the node fork was needed (the fork was ended at the deadline, or a slow stop kill used the whole tail first and it was skipped), and that row's subject is the surviving leg being ended, not which tail branch ran.
669+
const TAIL_PASSED_FOR_NODE = /the hard stop left no time for 'node'|no time left after the hard stop, so 'node' was skipped/
670+
668671
// R4: a fork that starts inside the tail and hangs (the duration record of the Windows leg, which finished before the stop) is ended at the tail deadline, so the hook returns inside the tail bound instead of waiting out the whole hang.
669672
hookRow('a fork that hangs inside the tail is ended at the tail deadline', () => {
670673
const r = runHook({ STUB_FIRE_STOP: 'typecheck', STUB_FIRE_AFTER_TESTS: '1', STUB_TYPECHECK_S: '60', ...hangingNode(false) })
@@ -685,7 +688,7 @@ describe('the hard stop ends the legs of a real hook run', () => {
685688
leftLegs = true
686689
expect(r.tailS, r.out).not.toBeNull()
687690
expect(r.tailS, r.out).toBeLessThan(TAIL_BOUND_S)
688-
expect(r.out).toContain("the hard stop left no time for 'node'")
691+
expect(r.out, 'the tail deadline had not passed for the node fork').toMatch(TAIL_PASSED_FOR_NODE)
689692
const pid = Number(readFileSync(path.join(stubs, 'typecheck.pid'), 'utf8').trim())
690693
expect(Number.isInteger(pid)).toBe(true)
691694
let alive = true

0 commit comments

Comments
 (0)