Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
*/
package io.javaoperatorsdk.operator;

import java.time.Duration;

public class IntegrationTestConstants {

public static final int GARBAGE_COLLECTION_TIMEOUT_SECONDS = 60;

public static final Duration GARBAGE_COLLECTION_TIMEOUT = Duration.ofSeconds(60);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.javaoperatorsdk.annotation.Sample;
import io.javaoperatorsdk.operator.junit.LocallyRunOperatorExtension;

import static io.javaoperatorsdk.operator.IntegrationTestConstants.GARBAGE_COLLECTION_TIMEOUT;
import static io.javaoperatorsdk.operator.baseapi.expectation.onallevent.ExpectationReconciler.DEPLOYMENT_READY;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
Expand Down Expand Up @@ -52,6 +53,7 @@ void testExpectation() {
extension.create(res);

await()
.timeout(GARBAGE_COLLECTION_TIMEOUT)
.untilAsserted(
() -> {
var actual = extension.get(ExpectationCustomResource.class, TEST_1);
Expand All @@ -67,6 +69,7 @@ void expectationTimeouts() {
extension.create(res);

await()
.timeout(GARBAGE_COLLECTION_TIMEOUT)
.untilAsserted(
() -> {
var actual = extension.get(ExpectationCustomResource.class, TEST_1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.javaoperatorsdk.annotation.Sample;
import io.javaoperatorsdk.operator.junit.LocallyRunOperatorExtension;

import static io.javaoperatorsdk.operator.IntegrationTestConstants.GARBAGE_COLLECTION_TIMEOUT;
import static io.javaoperatorsdk.operator.baseapi.expectation.periodicclean.PeriodicCleanerExpectationReconciler.DEPLOYMENT_READY;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
Expand Down Expand Up @@ -57,6 +58,7 @@ void testPeriodicCleanerExpectationBasicFlow() {
extension.create(res);

await()
.timeout(GARBAGE_COLLECTION_TIMEOUT)
.untilAsserted(
() -> {
var actual = extension.get(PeriodicCleanerExpectationCustomResource.class, TEST_1);
Expand All @@ -80,6 +82,7 @@ void demonstratesNoTriggerReconcilerOnAllEventsNeededForCleanup() {
var created = extension.create(res);

await()
.timeout(GARBAGE_COLLECTION_TIMEOUT)
.untilAsserted(
() -> {
assertThat(reconciler.getExpectationManager().getExpectation(created)).isPresent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void executeUpdateForTestingCacheUpdateForGetResource() {
void awaitForDeploymentReadyReplicas(int expectedReplicaCount) {
await()
.pollInterval(Duration.ofMillis(300))
.atMost(Duration.ofSeconds(50))
.atMost(Duration.ofSeconds(180))
.until(
() -> {
var deployment =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void successfullyReconciles() {
operator.create(testResource());

await()
.atMost(Duration.ofSeconds(90))
.atMost(Duration.ofSeconds(120))
.untilAsserted(
() -> {
var res = operator.get(ComplexWorkflowCustomResource.class, TEST_RESOURCE_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.javaoperatorsdk.annotation.Sample;
import io.javaoperatorsdk.operator.junit.LocallyRunOperatorExtension;

import static io.javaoperatorsdk.operator.IntegrationTestConstants.GARBAGE_COLLECTION_TIMEOUT;
import static io.javaoperatorsdk.operator.workflow.workflowallfeature.ConfigMapDependentResource.READY_TO_DELETE_ANNOTATION;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
Expand Down Expand Up @@ -69,7 +70,7 @@ void configMapNotReconciledUntilDeploymentReady() {
});

await()
.atMost(ONE_MINUTE)
.timeout(ONE_MINUTE)
.untilAsserted(
() -> {
assertThat(
Expand Down Expand Up @@ -107,6 +108,7 @@ void configMapNotReconciledIfReconcileConditionNotMet() {
operator.replace(resource);

await()
.timeout(GARBAGE_COLLECTION_TIMEOUT)
.untilAsserted(
() -> {
assertThat(operator.get(ConfigMap.class, RESOURCE_NAME)).isNotNull();
Expand Down Expand Up @@ -141,7 +143,7 @@ void configMapNotDeletedUntilNotMarked() {
markConfigMapForDelete();

await()
.atMost(ONE_MINUTE)
.timeout(GARBAGE_COLLECTION_TIMEOUT)
.untilAsserted(
() -> {
assertThat(operator.get(ConfigMap.class, RESOURCE_NAME)).isNull();
Expand Down