Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
test(relay): allow timer millisecond granularity [H18,C7]
Corey Olsond7c58eff523c
diff --git a/test/relay-deploy.test.js b/test/relay-deploy.test.jsindex 00235010..4a6401a1 100644--- a/test/relay-deploy.test.js+++ b/test/relay-deploy.test.js@@ -129,6 +129,11 @@ async function copiedServerFailure(child, budgetMs) {return { code: child.exitCode, description: `exited ${child.exitCode}` };}+/** Compare a rounded wait against its budget, allowing Node's whole-millisecond timer granularity. */+function damagedServerWaitMeetsBudget(elapsedMs, budgetMs) {+ return elapsedMs >= budgetMs - 1;+}+/** Require the Docker omission to fail before startup, naming the missing source and observed outcome. */async function requireCopiedServerFailure(child, budgetMs, omitted) {const outcome = await copiedServerFailure(child, budgetMs);@@ -411,7 +416,7 @@ test('[H5,H18] a damaged relay copy is judged by its own boot time', { timeout:'a damaged copy that never exits names the omitted file and its observed timeout',);const elapsed = Number(/still running after (\d+) ms/u.exec(neverMessage)?.[1]);- assert.ok(elapsed >= budgetMs, `the reported elapsed wait ${elapsed} ms reached the ${budgetMs} ms budget`);+ assert.ok(damagedServerWaitMeetsBudget(elapsed, budgetMs), `the reported elapsed wait ${elapsed} ms reached the ${budgetMs} ms budget (allowing one millisecond for timer granularity)`);const exitsZero = standInServer(t, 'setImmediate(() => process.exit(0))');await assert.rejects(requireCopiedServerFailure(exitsZero, budgetMs, 'src/relay/browser-model.js'),@@ -419,3 +424,9 @@ test('[H5,H18] a damaged relay copy is judged by its own boot time', { timeout:'a clean exit is identified as not being a startup failure',);});++test('a timer that fires a millisecond early still meets the damaged-copy budget [H18,C7]', () => {+ const budgetMs = DAMAGED_SERVER_FAILURE_FLOOR_MS;+ assert.equal(damagedServerWaitMeetsBudget(budgetMs - 1, budgetMs), true, 'one millisecond early fits timer granularity');+ assert.equal(damagedServerWaitMeetsBudget(budgetMs - 2, budgetMs), false, 'two milliseconds early remains below budget');+});