Skip to content

Commit

Permalink
time
Browse files Browse the repository at this point in the history
  • Loading branch information
chakaz committed Jan 19, 2025
1 parent 3cd1d61 commit dbb7bd3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bullmq-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ jobs:
#git clone https://github.com/taskforcesh/bullmq
cd bullmq
pwd
#patch -p1 -f < $GITHUB_WORKSPACE/bullmq.patch
patch -p1 -f < $GITHUB_WORKSPACE/bullmq.patch
yarn install
yarn build
sed -i 's/timeout: 4000/timeout: 10000/' .mocharc.js
for i in {1..30}; do
for i in {1..100}; do
BULLMQ_TEST_PREFIX={b} yarn test -g "should keep workers busy";
redis-cli info Commandstats
done
Expand Down
48 changes: 27 additions & 21 deletions bullmq.patch
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 },
);

0 comments on commit dbb7bd3

Please sign in to comment.