From 6ba6e630c7a87c393c5f9d0ae0fd9e7fbabde42a Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Mon, 25 May 2026 11:41:03 -0400 Subject: [PATCH] test(#192): stabilize graphify auto-update matcher assertions --- tests/graphify-auto-update.test.cjs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/graphify-auto-update.test.cjs b/tests/graphify-auto-update.test.cjs index 8eef4f30d..e4dc617f8 100644 --- a/tests/graphify-auto-update.test.cjs +++ b/tests/graphify-auto-update.test.cjs @@ -604,8 +604,15 @@ describe('auto-update', () => { { tool_name: 'Bash', tool_input: { command: cmd } }, { pathPrepend: mockBin }, ); + const statusPath = path.join(tmpDir, '.planning/graphs/.last-build-status.json'); + const waitBudgetMs = 2500; // 100 ms mock sleep + hook/detached bash startup slack + const maxIter = Math.ceil(waitBudgetMs / 100); + for (let i = 0; i < maxIter; i++) { + if (fs.existsSync(statusPath)) break; + atomicSleep(100); + } assert.ok( - fs.existsSync(path.join(tmpDir, '.planning/graphs/.last-build-status.json')), + fs.existsSync(statusPath), `must dispatch for HEAD-advancing op: ${cmd}`, ); });