From 111f7e6f1aa8baeec0d08164d59f83ff036ed106 Mon Sep 17 00:00:00 2001 From: Eureka Date: Sun, 8 Nov 2026 16:09:25 +0000 Subject: [PATCH] Mouth tests: the no-wait probe fails fast instead of hanging Co-Authored-By: Claude Sonnet 5.5 --- tests/persona-matrix-mouth.test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/persona-matrix-mouth.test.mjs b/tests/persona-matrix-mouth.test.mjs index 89c0432..bfa5f4b 100644 --- a/tests/persona-matrix-mouth.test.mjs +++ b/tests/persona-matrix-mouth.test.mjs @@ -1012,7 +1012,8 @@ test("the ack does not wait for the receipt", async () => { let release; const hs = await fakeHomeserver({ sync: receiptScript, deferReceipts: new Promise(r => { release = r; }) }); const mouth = await withMail(hs); - await mouth.ack(3); // resolves while the receipt response is held open + const outcome = await Promise.race([mouth.ack(3).then(() => "acked"), new Promise(r => setTimeout(() => r("waited on the receipt"), 500))]); + assert.equal(outcome, "acked", "the ack resolves while the receipt response is held open"); assert.equal(mouth.pendingCount, 0); release(); await until(() => hs.receipts().length >= 2);