Skip to content

Commit

Permalink
Don't use hazelcast executor in task scheduling #10122
Browse files Browse the repository at this point in the history
  • Loading branch information
vbradnitski committed Apr 21, 2023
1 parent 4784622 commit b0c0263
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ public void submitInOrder()

verify( taskService, times( 3 ) ).submitTask( taskCaptor.capture() );

assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getName() );
assertEquals( "job3", taskCaptor.getAllValues().get( 1 ).getName() );
assertEquals( "job2", taskCaptor.getAllValues().get( 2 ).getName() );
assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getDescriptorKey().getName() );
assertEquals( "job3", taskCaptor.getAllValues().get( 1 ).getDescriptorKey().getName() );
assertEquals( "job2", taskCaptor.getAllValues().get( 2 ).getDescriptorKey().getName() );
}

@Test
Expand All @@ -173,8 +173,8 @@ public void jobSubmitFailedButRetried()

verify( taskService, times( 2 ) ).submitTask( taskCaptor.capture() );

assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getName() );
assertEquals( "job2", taskCaptor.getAllValues().get( 1 ).getName() );
assertEquals( "job1", taskCaptor.getAllValues().get( 0 ).getDescriptorKey().getName() );
assertEquals( "job2", taskCaptor.getAllValues().get( 1 ).getDescriptorKey().getName() );

job1 = mockOneTimeJob( "job1", now.minus( 1, ChronoUnit.SECONDS ), now );
job2 = mockOneTimeJob( "job2", now, now );
Expand All @@ -185,7 +185,7 @@ public void jobSubmitFailedButRetried()

verify( taskService, times( 3 ) ).submitTask( taskCaptor.capture() );

assertEquals( "job1", taskCaptor.getAllValues().get( 2 ).getName() );
assertEquals( "job1", taskCaptor.getAllValues().get( 2 ).getDescriptorKey().getName() );

when( taskService.submitTask( isA( SubmitTaskParams.class ) ) ).thenThrow( new Error() );

Expand Down Expand Up @@ -341,7 +341,7 @@ private ScheduledJob mockOneTimeJob( final String scheduledJobName, final Instan
return ScheduledJob.create()
.name( ScheduledJobName.from( scheduledJobName ) )
.calendar( OneTimeCalendarImpl.create().value( instant ).build() )
.descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), "task3" ) )
.descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), scheduledJobName ) )
.config( new PropertyTree() )
.enabled( true )
.creator( PrincipalKey.from( "user:system:creator" ) )
Expand All @@ -363,7 +363,7 @@ private ScheduledJob mockCronJob( final String scheduledJobName, final String cr
return ScheduledJob.create()
.name( ScheduledJobName.from( scheduledJobName ) )
.calendar( CronCalendarImpl.create().value( cron ).timeZone( TimeZone.getDefault() ).build() )
.descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), "task2" ) )
.descriptor( DescriptorKey.from( ApplicationKey.from( "com.enonic.app.test" ), scheduledJobName ) )
.config( new PropertyTree() )
.enabled( true )
.creator( PrincipalKey.from( "user:system:creator" ) )
Expand Down

0 comments on commit b0c0263

Please sign in to comment.