From cd4592c98345ff5c84250cc6db1b9eb6f486715e Mon Sep 17 00:00:00 2001 From: lmossman Date: Wed, 29 Jun 2022 14:06:41 -0700 Subject: [PATCH] replace testEnv.sleep with Thread.sleep in several tests --- .../scheduling/ConnectionManagerWorkflowTest.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java index 4e5594295912..5c7b100eb67a 100644 --- a/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java +++ b/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java @@ -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") @@ -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 events = testStateListener.events(testId); @@ -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") @@ -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 events = testStateListener.events(testId); @@ -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") @@ -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 eventQueue = testStateListener.events(testId); final List events = new ArrayList<>(eventQueue); @@ -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();