Skip to content

Commit

Permalink
chore: attempt to fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Dec 4, 2024
1 parent 8005194 commit 62c9316
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/test_job_scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1222,20 +1222,19 @@ describe('Job Scheduler', function () {
this.clock.tick(nextMonth - now);
};

const worker = new Worker(
queueName,
async () => {
nextTick();
},
{ autorun: false, connection, prefix },
);
const worker = new Worker(queueName, async () => {}, {
autorun: false,
connection,
prefix,
});
const delayStub = sinon.stub(worker, 'delay').callsFake(async () => {});

let counter = 25;
let prev: Job;
const completing = new Promise<void>((resolve, reject) => {
worker.on('completed', async job => {
try {
nextTick();
if (prev) {
expect(prev.timestamp).to.be.lt(job.timestamp);
const diff = moment(job.processedOn!).diff(
Expand Down

0 comments on commit 62c9316

Please sign in to comment.