Skip to content

Commit

Permalink
Fix flaky actions auto cleanup test (#1561)
Browse files Browse the repository at this point in the history
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com
  • Loading branch information
avgustinmm committed Jan 23, 2024
1 parent 49a5509 commit 274d0b0
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -58,6 +58,7 @@ public void runningActionsAreNotCleanedUp() {

assertThat(actionRepository.count()).isEqualTo(2);

waitNextMillis();
autoActionCleanup.run();

assertThat(actionRepository.count()).isEqualTo(2);
Expand All @@ -84,6 +85,7 @@ public void cleanupDisabled() {

assertThat(actionRepository.count()).isEqualTo(2);

waitNextMillis();
autoActionCleanup.run();

assertThat(actionRepository.count()).isEqualTo(2);
Expand Down Expand Up @@ -148,6 +150,7 @@ public void canceledActionsAreCleanedUp() {

assertThat(actionRepository.count()).isEqualTo(3);

waitNextMillis();
autoActionCleanup.run();

assertThat(actionRepository.count()).isEqualTo(2);
Expand Down Expand Up @@ -180,6 +183,7 @@ public void canceledAndFailedActionsAreCleanedUpWhenExpired() throws Interrupted
setActionToCanceled(action1);
setActionToFailed(action2);

waitNextMillis();
autoActionCleanup.run();

// actions have not expired yet
Expand Down Expand Up @@ -210,5 +214,4 @@ private void setupCleanupConfiguration(final boolean cleanupEnabled, final long
tenantConfigurationManagement.addOrUpdateConfiguration(ACTION_CLEANUP_ACTION_STATUS,
Arrays.stream(status).map(Status::toString).collect(Collectors.joining(",")));
}

}

0 comments on commit 274d0b0

Please sign in to comment.