File tree Expand file tree Collapse file tree 6 files changed +16
-4
lines changed
operator-framework/src/test/java/io/javaoperatorsdk/operator
dependent/standalonedependent Expand file tree Collapse file tree 6 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1515 */
1616package io .javaoperatorsdk .operator ;
1717
18+ import java .time .Duration ;
19+
1820public class IntegrationTestConstants {
1921
2022 public static final int GARBAGE_COLLECTION_TIMEOUT_SECONDS = 60 ;
23+
24+ public static final Duration GARBAGE_COLLECTION_TIMEOUT = Duration .ofSeconds (60 );
2125}
Original file line number Diff line number Diff line change 2424import io .javaoperatorsdk .annotation .Sample ;
2525import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
2626
27+ import static io .javaoperatorsdk .operator .IntegrationTestConstants .GARBAGE_COLLECTION_TIMEOUT ;
2728import static io .javaoperatorsdk .operator .baseapi .expectation .onallevent .ExpectationReconciler .DEPLOYMENT_READY ;
2829import static org .assertj .core .api .Assertions .assertThat ;
2930import static org .awaitility .Awaitility .await ;
@@ -52,6 +53,7 @@ void testExpectation() {
5253 extension .create (res );
5354
5455 await ()
56+ .timeout (GARBAGE_COLLECTION_TIMEOUT )
5557 .untilAsserted (
5658 () -> {
5759 var actual = extension .get (ExpectationCustomResource .class , TEST_1 );
@@ -67,6 +69,7 @@ void expectationTimeouts() {
6769 extension .create (res );
6870
6971 await ()
72+ .timeout (GARBAGE_COLLECTION_TIMEOUT )
7073 .untilAsserted (
7174 () -> {
7275 var actual = extension .get (ExpectationCustomResource .class , TEST_1 );
Original file line number Diff line number Diff line change 2424import io .javaoperatorsdk .annotation .Sample ;
2525import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
2626
27+ import static io .javaoperatorsdk .operator .IntegrationTestConstants .GARBAGE_COLLECTION_TIMEOUT ;
2728import static io .javaoperatorsdk .operator .baseapi .expectation .periodicclean .PeriodicCleanerExpectationReconciler .DEPLOYMENT_READY ;
2829import static org .assertj .core .api .Assertions .assertThat ;
2930import static org .awaitility .Awaitility .await ;
@@ -57,6 +58,7 @@ void testPeriodicCleanerExpectationBasicFlow() {
5758 extension .create (res );
5859
5960 await ()
61+ .timeout (GARBAGE_COLLECTION_TIMEOUT )
6062 .untilAsserted (
6163 () -> {
6264 var actual = extension .get (PeriodicCleanerExpectationCustomResource .class , TEST_1 );
@@ -80,6 +82,7 @@ void demonstratesNoTriggerReconcilerOnAllEventsNeededForCleanup() {
8082 var created = extension .create (res );
8183
8284 await ()
85+ .timeout (GARBAGE_COLLECTION_TIMEOUT )
8386 .untilAsserted (
8487 () -> {
8588 assertThat (reconciler .getExpectationManager ().getExpectation (created )).isPresent ();
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ void executeUpdateForTestingCacheUpdateForGetResource() {
9393 void awaitForDeploymentReadyReplicas (int expectedReplicaCount ) {
9494 await ()
9595 .pollInterval (Duration .ofMillis (300 ))
96- .atMost (Duration .ofSeconds (50 ))
96+ .atMost (Duration .ofSeconds (180 ))
9797 .until (
9898 () -> {
9999 var deployment =
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ void successfullyReconciles() {
5555 operator .create (testResource ());
5656
5757 await ()
58- .atMost (Duration .ofSeconds (90 ))
58+ .atMost (Duration .ofSeconds (120 ))
5959 .untilAsserted (
6060 () -> {
6161 var res = operator .get (ComplexWorkflowCustomResource .class , TEST_RESOURCE_NAME );
Original file line number Diff line number Diff line change 2727import io .javaoperatorsdk .annotation .Sample ;
2828import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
2929
30+ import static io .javaoperatorsdk .operator .IntegrationTestConstants .GARBAGE_COLLECTION_TIMEOUT ;
3031import static io .javaoperatorsdk .operator .workflow .workflowallfeature .ConfigMapDependentResource .READY_TO_DELETE_ANNOTATION ;
3132import static org .assertj .core .api .Assertions .assertThat ;
3233import static org .awaitility .Awaitility .await ;
@@ -69,7 +70,7 @@ void configMapNotReconciledUntilDeploymentReady() {
6970 });
7071
7172 await ()
72- .atMost (ONE_MINUTE )
73+ .timeout (ONE_MINUTE )
7374 .untilAsserted (
7475 () -> {
7576 assertThat (
@@ -107,6 +108,7 @@ void configMapNotReconciledIfReconcileConditionNotMet() {
107108 operator .replace (resource );
108109
109110 await ()
111+ .timeout (GARBAGE_COLLECTION_TIMEOUT )
110112 .untilAsserted (
111113 () -> {
112114 assertThat (operator .get (ConfigMap .class , RESOURCE_NAME )).isNotNull ();
@@ -141,7 +143,7 @@ void configMapNotDeletedUntilNotMarked() {
141143 markConfigMapForDelete ();
142144
143145 await ()
144- .atMost ( ONE_MINUTE )
146+ .timeout ( GARBAGE_COLLECTION_TIMEOUT )
145147 .untilAsserted (
146148 () -> {
147149 assertThat (operator .get (ConfigMap .class , RESOURCE_NAME )).isNull ();
You can’t perform that action at this time.
0 commit comments