Skip to content

Commit afbde34

Browse files
committed
fix(tests): use the fixture lock-observation deadline explicitly
1 parent 044913a commit afbde34

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎apps/sim/lib/knowledge/__integration__/connector-lease-pages.integration.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,18 @@ describe('connector lease ACL pages in PostgreSQL', () => {
380380
})
381381

382382
async function waitForDocumentLock(): Promise<number> {
383-
return vi.waitFor(async () => {
384-
const [row] = await db.execute<{ pid: number }>(sql`
383+
return vi.waitFor(
384+
async () => {
385+
const [row] = await db.execute<{ pid: number }>(sql`
385386
SELECT pid FROM pg_stat_activity
386387
WHERE wait_event_type = 'Lock' AND datname = current_database()
387388
AND (query ILIKE 'update "document" set "acl"%'
388389
OR query ILIKE 'select "id", "chunk_count" from "document"%for update')`)
389-
if (!row) throw new Error('Document ACL writer has not reached the held row')
390-
return row.pid
391-
})
390+
if (!row) throw new Error('Document ACL writer has not reached the held row')
391+
return row.pid
392+
},
393+
{ timeout: 5_000, interval: 10 }
394+
)
392395
}
393396

394397
describe('fence-last pages', () => {

0 commit comments

Comments
 (0)