Skip to content

Commit

Permalink
replace testEnv.sleep with Thread.sleep in several tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lmossman committed Jun 29, 2022
1 parent c94eaa2 commit cd4592c
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public void cancelNonRunning() throws InterruptedException {
Mockito.verifyNoInteractions(mJobCreationAndStatusUpdateActivity);
}

@Test
@RepeatedTest(100)
@Timeout(value = 2,
unit = TimeUnit.SECONDS)
@DisplayName("Test that the sync is properly deleted")
Expand All @@ -430,7 +430,7 @@ public void deleteSync() throws InterruptedException {
startWorkflowAndWaitUntilReady(workflow, input);
testEnv.sleep(Duration.ofSeconds(30L));
workflow.deleteConnection();
testEnv.sleep(Duration.ofMinutes(20L));
Thread.sleep(500);

final Queue<ChangedStateEvent> events = testStateListener.events(testId);

Expand Down Expand Up @@ -638,7 +638,7 @@ public void deleteRunning() throws InterruptedException {
.jobCancelledWithAttemptNumber(Mockito.argThat(new HasCancellationFailure(JOB_ID, ATTEMPT_ID)));
}

@Test
@RepeatedTest(100)
@Timeout(value = 2,
unit = TimeUnit.SECONDS)
@DisplayName("Test that resetting a non-running workflow starts a reset job")
Expand All @@ -660,7 +660,7 @@ public void resetStart() throws InterruptedException {
startWorkflowAndWaitUntilReady(workflow, input);
testEnv.sleep(Duration.ofMinutes(5L));
workflow.resetConnection();
testEnv.sleep(Duration.ofMinutes(15L));
Thread.sleep(500);

final Queue<ChangedStateEvent> events = testStateListener.events(testId);

Expand All @@ -670,7 +670,7 @@ public void resetStart() throws InterruptedException {

}

@Test
@RepeatedTest(100)
@Timeout(value = 60,
unit = TimeUnit.SECONDS)
@DisplayName("Test that resetting a running workflow cancels the running workflow")
Expand All @@ -695,7 +695,7 @@ public void resetCancelRunningWorkflow() throws InterruptedException {
workflow.submitManualSync();
testEnv.sleep(Duration.ofSeconds(30L));
workflow.resetConnection();
testEnv.sleep(Duration.ofMinutes(15L));
Thread.sleep(500);

final Queue<ChangedStateEvent> eventQueue = testStateListener.events(testId);
final List<ChangedStateEvent> events = new ArrayList<>(eventQueue);
Expand All @@ -718,7 +718,6 @@ public void resetCancelRunningWorkflow() throws InterruptedException {
@Timeout(value = 60,
unit = TimeUnit.SECONDS)
@DisplayName("Test that cancelling a reset deletes streamsToReset from stream_resets table")
@Disabled
public void cancelResetRemovesStreamsToReset() throws InterruptedException {
final UUID connectionId = UUID.randomUUID();
final UUID testId = UUID.randomUUID();
Expand Down

0 comments on commit cd4592c

Please sign in to comment.