@crouton-kit/crouter 0.3.62 → 0.3.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -72,14 +72,28 @@ test('CRASH → grace-revive RESUME (one-writer), then clean teardown on close',
|
|
|
72
72
|
// --- Items 4 + 6: kill the broker out from under the daemon (a crash). Drive a
|
|
73
73
|
// FIXED clock so the grace window is exercised deterministically. ---
|
|
74
74
|
process.kill(oldPid, 'SIGKILL');
|
|
75
|
+
// ONE-WRITER: the old engine pid is dead BEFORE any revive can launch. Assert
|
|
76
|
+
// this via the waitFor alone — a raw isPidAlive RE-CHECK immediately after
|
|
77
|
+
// would re-probe the same numeric pid a moment later, and on a heavily
|
|
78
|
+
// forking CI runner (test-concurrency=4 x full-tier broker spawns) the OS can
|
|
79
|
+
// recycle a just-freed low pid to an unrelated fresh process inside that gap,
|
|
80
|
+
// reporting "alive" for a pid that never resurrected (proven by a real
|
|
81
|
+
// Actions run: crouter-development/prove-ci-fixes-in-actions). The waitFor's
|
|
82
|
+
// successful resolution already IS the proof of deadness at this point.
|
|
75
83
|
await h.waitFor(() => !isPidAlive(oldPid), { label: 'crashed broker pid is dead' });
|
|
76
|
-
// ONE-WRITER: the old engine pid is dead BEFORE any revive can launch.
|
|
77
|
-
assert.equal(isPidAlive(oldPid), false, 'crashed pid dead before the daemon revives');
|
|
78
84
|
const NOW = 5_000_000;
|
|
79
85
|
await h.tick(NOW); // pid dead, intent null → handleBrokerLiveness → handleLiveWindow marks pending
|
|
80
86
|
assert.equal(h.bootCount(id), boots, 'inside the grace window → NOT yet revived');
|
|
81
87
|
await h.tick(NOW + REVIVE_GRACE_MS + 1); // grace elapsed → reviveNode(resume:true)
|
|
82
|
-
|
|
88
|
+
// This is the file's SECOND real broker boot (crash-revive), on an
|
|
89
|
+
// oversubscribed CI runner sharing the host with the other full-tier files'
|
|
90
|
+
// own broker spawns. Locally this boot lands in ~16s total for the whole
|
|
91
|
+
// test; real Actions runs proved the harness's normal 30s awaitBoot default
|
|
92
|
+
// insufficient, and on a genuinely noisy runner even 60s (measured: one real
|
|
93
|
+
// run's boot took ~65–75s) — crouter-development/prove-ci-fixes-in-actions.
|
|
94
|
+
// Give it a wide, still-bounded ceiling rather than tuning down the shared
|
|
95
|
+
// harness default for every other (cheaper, single-boot) full-tier test.
|
|
96
|
+
const boot2 = await h.awaitBoot(id, { minCount: boots + 1, timeoutMs: 120_000 });
|
|
83
97
|
assert.equal(boot2.resuming, true, 'grace-revive RESUMES the saved .jsonl');
|
|
84
98
|
const newPid = h.node(id).pi_pid;
|
|
85
99
|
assert.ok(newPid != null && isPidAlive(newPid), 'the revived broker pid is alive');
|