From ae0216137f57b0f1e509e1b9e3638f1a096d2a22 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 4 Nov 2026 00:47:17 +0530 Subject: [PATCH] test(release-gate): accept the worker's own error in inline-worker-fatal When the readiness timeout fires, the CLI asks Worker Compose for status. If Compose has already marked the crashed worker failed, the CLI reports that failure, including the worker's "could not create its API secret" error, instead of the generic "not ready after 3s" text. Which message wins depends on how fast Compose records the exit, so the scenario failed on unrelated pull requests on both Linux and macOS. The scenario now accepts either message. It still asserts a non-zero exit and that the worker log holds the secret error. --- scripts/release-gate/startup.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/release-gate/startup.mjs b/scripts/release-gate/startup.mjs index 317b10119d..156af0fc73 100644 --- a/scripts/release-gate/startup.mjs +++ b/scripts/release-gate/startup.mjs @@ -336,7 +336,10 @@ async function fixtureServer(instance, livez) { async function expectFailure(instance, args, env, { budgetMs = 5000, message } = {}) { const at = Date.now(); const child = instance.start(args, env); const result = await exited(child, budgetMs); assert.notEqual(result.code, 0, `CLI incorrectly succeeded: ${child.text}`); - if (message) assert(child.text.includes(message), `Missing ${message}: ${child.text.slice(-1500)}`); + if (message) { + const found = message instanceof RegExp ? message.test(child.text) : child.text.includes(message); + assert(found, `Missing ${message}: ${child.text.slice(-1500)}`); + } return { elapsedMs: Date.now() - at, exitCode: result.code }; } @@ -421,7 +424,7 @@ async function main() { await scenario("inline-worker-fatal", async (i, d) => { const workerData = join(i.data, "fatal-worker-data"); mkdirSync(join(workerData, "secret"), { recursive: true }); const config = i.config({ workerDataDir: workerData }); await i.startEngine(config); - Object.assign(d, await expectFailure(i, ["--no-engine"], { AGENTMEMORY_READY_TIMEOUT_MS: "3000" }, { budgetMs: 10_000, message: "3s" })); + Object.assign(d, await expectFailure(i, ["--no-engine"], { AGENTMEMORY_READY_TIMEOUT_MS: "3000" }, { budgetMs: 10_000, message: /3s|could not create its API secret/ })); const workerLogs = readdirSync(join(i.data, "compose-state"), { withFileTypes: true }) .filter((entry) => entry.isDirectory()) .flatMap((entry) => { const stateRoot = join(i.data, "compose-state", entry.name); return readdirSync(stateRoot, { withFileTypes: true }).filter((project) => project.isDirectory()).map((project) => join(stateRoot, project.name, "logs", "agentmemory.log")); })