From 5e7a965ac18d4a4c215bbc342bbdde26c770f3ec Mon Sep 17 00:00:00 2001 From: Niko1221 Date: Fri, 16 Oct 2026 20:06:04 +0200 Subject: [PATCH] Queued-message test: ask Stop again when it answers still stopping --- apps/host/tests/agent-plan-run.test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/host/tests/agent-plan-run.test.mjs b/apps/host/tests/agent-plan-run.test.mjs index 29f17670..4a40a6c9 100644 --- a/apps/host/tests/agent-plan-run.test.mjs +++ b/apps/host/tests/agent-plan-run.test.mjs @@ -102,7 +102,8 @@ test('a message typed while a goal without points runs is queued, can be taken b const back = r.bridge.cancelQueued({ chatId: 'q1', id: b.message.id }); assert.deepEqual(back.queue.map(m => m.text), ['first thing']); assert.throws(() => r.bridge.cancelQueued({ chatId: 'q1', id: b.message.id }), /already sent or removed/); - await r.bridge.stop('q1'); + // Stop may answer 'still stopping' on a busy machine: ask again until the run has ended + for (let i = 0; i < 5; i++) { const st = await r.bridge.stop('q1'); if (st.stopped || !r.bridge.isRunning('q1')) break; } await run; const rel = out.find(f => f.type === 'queued-release'); assert.deepEqual(rel.messages.map(m => m.text), ['first thing']);