Skip to content

Commit

Permalink
test(getters): add timeout for wait to ready
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Mar 2, 2023
1 parent 4cbc9ca commit bd18ef4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ describe('Jobs getters', function () {
autorun: false,
connection: ioredisConnection,
});
await new Promise<void>(resolve => {
await new Promise<void>(async resolve => {
worker.on('ready', () => {
resolve();
});
await delay(1000);
resolve();
});

const workers = await queue.getWorkers();
Expand All @@ -131,10 +133,12 @@ describe('Jobs getters', function () {
const worker2 = new Worker(queueName, async () => {}, {
connection: ioredisConnection,
});
await new Promise<void>(resolve => {
await new Promise<void>(async resolve => {
worker2.on('ready', () => {
resolve();
});
await delay(1000);
resolve();
});

const nextWorkers = await queue.getWorkers();
Expand Down

0 comments on commit bd18ef4

Please sign in to comment.