Skip to content

Commit dbb7bd3

Browse files
author
shahar
committed
time
1 parent 3cd1d61 commit dbb7bd3

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

.github/workflows/bullmq-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ jobs:
6666
#git clone https://github.com/taskforcesh/bullmq
6767
cd bullmq
6868
pwd
69-
#patch -p1 -f < $GITHUB_WORKSPACE/bullmq.patch
69+
patch -p1 -f < $GITHUB_WORKSPACE/bullmq.patch
7070
yarn install
7171
yarn build
7272
sed -i 's/timeout: 4000/timeout: 10000/' .mocharc.js
73-
for i in {1..30}; do
73+
for i in {1..100}; do
7474
BULLMQ_TEST_PREFIX={b} yarn test -g "should keep workers busy";
7575
redis-cli info Commandstats
7676
done

bullmq.patch

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
diff --git a/tests/test_job.ts b/tests/test_job.ts
2-
index 0393fe0..57b06d6 100644
3-
--- a/tests/test_job.ts
4-
+++ b/tests/test_job.ts
5-
@@ -1396,6 +1396,8 @@ describe('Job', function () {
6-
expect(isDelayedAfterPromote).to.be.equal(false);
7-
const isCompleted = await job.isCompleted();
8-
expect(isCompleted).to.be.equal(true);
9-
+
10-
+ await worker.close();
11-
});
1+
diff --git a/tests/test_bulk.ts b/tests/test_bulk.ts
2+
index cdaa97ea7..ccf5e9d9c 100644
3+
--- a/tests/test_bulk.ts
4+
+++ b/tests/test_bulk.ts
5+
@@ -123,18 +123,23 @@ describe('bulk jobs', () => {
6+
const numJobs = 6;
7+
const queueEvents = new QueueEvents(queueName, { connection, prefix });
8+
await queueEvents.waitUntilReady();
9+
+ const gettime = () => '[' + new Date().toJSON() + ']';
1210

13-
describe('when re-adding same repeatable job after previous delayed one is promoted', () => {
14-
@@ -1456,6 +1458,8 @@ describe('Job', function () {
15-
const delayedCountAfterReAddition = await queue.getDelayedCount();
16-
expect(completedCountAfterReAddition).to.be.equal(1);
17-
expect(delayedCountAfterReAddition).to.be.equal(1);
18-
+
19-
+ await worker.close();
20-
});
21-
});
22-
});
11+
const worker = new Worker(
12+
queueName,
13+
async () => {
14+
+ console.log(`${gettime()} Pre wait 1`);
15+
await delay(900);
16+
+ console.log(`${gettime()} Post wait 1`);
17+
},
18+
{ connection, prefix },
19+
);
20+
const worker2 = new Worker(
21+
queueName,
22+
async () => {
23+
+ console.log(`${gettime()} Pre wait 2`);
24+
await delay(900);
25+
+ console.log(`${gettime()} Post wait 2`);
26+
},
27+
{ connection, prefix },
28+
);

0 commit comments

Comments
 (0)