Skip to content

Commit

Permalink
do not depend on timing in test
Browse files Browse the repository at this point in the history
  • Loading branch information
chm-diederichs committed Jun 10, 2024
1 parent 569b7b6 commit c0a9df4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/replicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,6 @@ test('session id reuse does not stall', async function (t) {

test('restore after cancelled block request', async function (t) {
t.plan(2)
t.timeout(90_000)

const a = await create()
const b = await create(a.key)
Expand All @@ -1526,17 +1525,14 @@ test('restore after cancelled block request', async function (t) {
await new Promise(resolve => b.on('append', resolve))

const session = b.session()
const promise = session.get(a.length)
const promise = t.exception(session.get(a.length))

a.on('upload', () => session.close()) // close before processing

// trigger upgrade
a.append([b4a.from([4]), b4a.from([5])])

await t.exception(promise)

// replication should recover
await new Promise(resolve => setTimeout(resolve, 200))
await new Promise(resolve => b.on('append', resolve))

t.is(b.length, a.length)
})
Expand Down

0 comments on commit c0a9df4

Please sign in to comment.