Skip to content

Commit

Permalink
chore: increase duration of long-running task in test
Browse files Browse the repository at this point in the history
  • Loading branch information
jedlikowski committed Sep 30, 2024
1 parent be9bbc1 commit d93793d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/fn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ test('subsequent executions after timeout', async () => {
const syncFn = createSyncFn<AsyncWorkerFn>(workerCjsPath)

// start an execution in worker that will definitely time out
expect(() => syncFn(1, SYNCKIT_TIMEOUT * 2)).toThrow(
expect(() => syncFn(1, SYNCKIT_TIMEOUT * 3)).toThrow(
'Internal error: Atomics.wait() failed: timed-out',
)

// wait for timed out execution to finish inside worker
await new Promise(resolve => setTimeout(resolve, SYNCKIT_TIMEOUT * 2))
await new Promise(resolve => setTimeout(resolve, SYNCKIT_TIMEOUT * 3))

// subsequent executions should work correctly
expect(syncFn(2, 1)).toBe(2)
Expand Down

0 comments on commit d93793d

Please sign in to comment.