Skip to content

Commit

Permalink
fix(test): debug failed lock expire test
Browse files Browse the repository at this point in the history
  • Loading branch information
simllll committed Oct 20, 2020
1 parent 924287c commit 7d69680
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/job.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,15 +844,18 @@ describe('Job', () => {
'lock job',
async _job => {
runCount++;
console.log('runCount', runCount);
if (runCount === 1) {
// this should time out
await new Promise(longResolve => setTimeout(longResolve, 1000));
} else {
await new Promise(longResolve => setTimeout(longResolve, 10));
resolve(runCount);
}
},
{
lockLifetime: 50
lockLifetime: 50,
concurrency: 1
}
);
});
Expand Down Expand Up @@ -1094,7 +1097,6 @@ describe('Job', () => {
const checkResultsPromise = new Promise(resolve =>
agenda.on('start:priority', job => {
results.push(job.attrs.priority);
console.log('RESULTS',results);
if (results.length !== 3) {
return;
}
Expand Down

0 comments on commit 7d69680

Please sign in to comment.