From 9870a311f459cfb007062621988070aa106e7f80 Mon Sep 17 00:00:00 2001 From: Aashish John Date: Fri, 11 Aug 2023 18:17:26 -0400 Subject: [PATCH] test: check for race condition --- src/server/api/lib/message-sending.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/api/lib/message-sending.spec.ts b/src/server/api/lib/message-sending.spec.ts index 96090f1ee..b740658fe 100644 --- a/src/server/api/lib/message-sending.spec.ts +++ b/src/server/api/lib/message-sending.spec.ts @@ -1,5 +1,6 @@ import type { PoolClient } from "pg"; import { Pool } from "pg"; +import { sleep } from "src/lib"; import supertest from "supertest"; import { createOrgAndSession } from "../../../../__test__/lib/session"; @@ -174,6 +175,7 @@ describe("automatic message handling", () => { }); await sendReply(agent, testbed.cookies, testbed.contact.id, "YES!"); + sleep(5000); const { rows: [retryJobs] } = await pool.query(