Skip to content

Commit

Permalink
chore: fix tests with timing
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Dec 5, 2024
1 parent 8891c84 commit 37c202d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
48 changes: 33 additions & 15 deletions tests/test_flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2810,11 +2810,17 @@ describe('flows', () => {
const testQueueName = `test-queue-${v4()}`;
const testQueue = new Queue(testQueueName, { connection, prefix });

const worker = new Worker(testQueueName, async () => {}, {
autorun: false,
connection,
prefix,
});
const worker = new Worker(
testQueueName,
async () => {
+(await delay(100));
},
{
autorun: false,
connection,
prefix,
},
);

await worker.waitUntilReady();

Expand Down Expand Up @@ -2850,11 +2856,17 @@ describe('flows', () => {
const testQueueName = `test-queue-${v4()}`;
const testQueue = new Queue(testQueueName, { connection, prefix });

const worker = new Worker(testQueueName, async () => {}, {
autorun: false,
connection,
prefix,
});
const worker = new Worker(
testQueueName,
async () => {
await delay(100);
},
{
autorun: false,
connection,
prefix,
},
);

await worker.waitUntilReady();

Expand Down Expand Up @@ -2890,11 +2902,17 @@ describe('flows', () => {
const testQueueName = `test-queue-${v4()}`;
const testQueue = new Queue(testQueueName, { connection, prefix });

const worker = new Worker(testQueueName, async () => {}, {
autorun: false,
connection,
prefix,
});
const worker = new Worker(
testQueueName,
async () => {
await delay(100);
},
{
autorun: false,
connection,
prefix,
},
);

await worker.waitUntilReady();

Expand Down
2 changes: 1 addition & 1 deletion tests/test_repeat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ describe('repeat', function () {
});

it('should repeat 7:th day every month at 9:25', async function () {
this.timeout(8000);
this.timeout(15000);

const date = new Date('2017-02-02 7:21:42');
this.clock.setSystemTime(date);
Expand Down

0 comments on commit 37c202d

Please sign in to comment.