-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
diff --git a/tests/test_job.ts b/tests/test_job.ts | ||
index 0393fe0..57b06d6 100644 | ||
--- a/tests/test_job.ts | ||
+++ b/tests/test_job.ts | ||
@@ -1396,6 +1396,8 @@ describe('Job', function () { | ||
expect(isDelayedAfterPromote).to.be.equal(false); | ||
const isCompleted = await job.isCompleted(); | ||
expect(isCompleted).to.be.equal(true); | ||
+ | ||
+ await worker.close(); | ||
}); | ||
diff --git a/tests/test_bulk.ts b/tests/test_bulk.ts | ||
index cdaa97ea7..ccf5e9d9c 100644 | ||
--- a/tests/test_bulk.ts | ||
+++ b/tests/test_bulk.ts | ||
@@ -123,18 +123,23 @@ describe('bulk jobs', () => { | ||
const numJobs = 6; | ||
const queueEvents = new QueueEvents(queueName, { connection, prefix }); | ||
await queueEvents.waitUntilReady(); | ||
+ const gettime = () => '[' + new Date().toJSON() + ']'; | ||
|
||
describe('when re-adding same repeatable job after previous delayed one is promoted', () => { | ||
@@ -1456,6 +1458,8 @@ describe('Job', function () { | ||
const delayedCountAfterReAddition = await queue.getDelayedCount(); | ||
expect(completedCountAfterReAddition).to.be.equal(1); | ||
expect(delayedCountAfterReAddition).to.be.equal(1); | ||
+ | ||
+ await worker.close(); | ||
}); | ||
}); | ||
}); | ||
const worker = new Worker( | ||
queueName, | ||
async () => { | ||
+ console.log(`${gettime()} Pre wait 1`); | ||
await delay(900); | ||
+ console.log(`${gettime()} Post wait 1`); | ||
}, | ||
{ connection, prefix }, | ||
); | ||
const worker2 = new Worker( | ||
queueName, | ||
async () => { | ||
+ console.log(`${gettime()} Pre wait 2`); | ||
await delay(900); | ||
+ console.log(`${gettime()} Post wait 2`); | ||
}, | ||
{ connection, prefix }, | ||
); |