File tree 1 file changed +12
-11
lines changed
1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -865,20 +865,21 @@ describe('Job', () => {
865
865
} ) ;
866
866
867
867
// @todo fix this test
868
- // it('does not on-the-fly lock more than definition.lockLimit jobs', async() => {
869
- // agenda.define('lock job', {lockLimit: 1}, (job, cb) => {}); // eslint-disable-line no-unused-vars
868
+ // does not on-the-fly lock more than definition.lockLimit jobs
869
+ it ( 'broken-test' , async ( ) => {
870
+ agenda . define ( 'lock job' , { lockLimit : 1 } , ( job , cb ) => { } ) ; // eslint-disable-line no-unused-vars
870
871
871
- // await agenda.start();
872
+ await agenda . start ( ) ;
872
873
873
- // await Promise.all([
874
- // agenda.now('lock job', {i: 1}),
875
- // agenda.now('lock job', {i: 2})
876
- // ]);
874
+ await Promise . all ( [
875
+ agenda . now ( 'lock job' , { i : 1 } ) ,
876
+ agenda . now ( 'lock job' , { i : 2 } )
877
+ ] ) ;
877
878
878
- // await delay(500);
879
- // expect(agenda._lockedJobs).to.have.length(1);
880
- // await agenda.stop();
881
- // });
879
+ await delay ( 500 ) ;
880
+ expect ( agenda . _lockedJobs ) . to . have . length ( 1 ) ;
881
+ await agenda . stop ( ) ;
882
+ } ) ;
882
883
883
884
it ( 'does not lock more than agenda._lockLimit jobs during processing interval' , async ( ) => {
884
885
agenda . lockLimit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments