Skip to content

Commit

Permalink
Fix flaky db test (#1287)
Browse files Browse the repository at this point in the history
fix flaky db test
  • Loading branch information
dholms authored Jul 6, 2023
1 parent 7e0201d commit 60e8284
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/pds/tests/db.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ describe('db', () => {
const leader2 = new Leader(777, db)
const leader3 = new Leader(777, db)
const result1 = await leader1.run(task)
await wait(1) // Short grace period for pg to close session
await wait(5) // Short grace period for pg to close session
const result2 = await leader2.run(task)
await wait(1)
await wait(5)
const result3 = await leader3.run(task)
await wait(1)
await wait(5)
const result4 = await leader3.run(task)
expect([result1, result2, result3, result4]).toEqual([
{ ran: true, result: 'complete' },
Expand All @@ -226,7 +226,7 @@ describe('db', () => {
})

it('only allows one leader at a time.', async () => {
await wait(1)
await wait(5)
const task = async () => {
await wait(25)
return 'complete'
Expand All @@ -245,7 +245,7 @@ describe('db', () => {
})

it('leaders with different ids do not conflict.', async () => {
await wait(1)
await wait(5)
const task = async () => {
await wait(25)
return 'complete'
Expand Down

0 comments on commit 60e8284

Please sign in to comment.