diff --git a/operator/src/test/java/org/keycloak/operator/testsuite/integration/BaseOperatorTest.java b/operator/src/test/java/org/keycloak/operator/testsuite/integration/BaseOperatorTest.java index 0ad805972a..2c07bf3c8a 100644 --- a/operator/src/test/java/org/keycloak/operator/testsuite/integration/BaseOperatorTest.java +++ b/operator/src/test/java/org/keycloak/operator/testsuite/integration/BaseOperatorTest.java @@ -51,6 +51,7 @@ import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecBuilder; import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakSpecFluent.UnsupportedNested; import org.keycloak.operator.crds.v2alpha1.deployment.KeycloakStatus; import org.keycloak.operator.crds.v2alpha1.deployment.spec.UnsupportedSpecFluent.PodTemplateNested; +import org.keycloak.operator.crds.v2alpha1.realmimport.KeycloakRealmImport; import org.keycloak.operator.testsuite.utils.K8sUtils; import org.opentest4j.TestAbortedException; @@ -63,6 +64,7 @@ import java.net.URL; import java.time.Duration; import java.util.Optional; import java.util.UUID; +import java.util.concurrent.TimeUnit; import jakarta.enterprise.inject.Instance; import jakarta.enterprise.inject.spi.CDI; @@ -156,6 +158,9 @@ public class BaseOperatorTest implements QuarkusTestAfterEachCallback { static void createCRDs(KubernetesClient client) throws FileNotFoundException { K8sUtils.set(client, new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloaks.k8s.keycloak.org-v1.yml")); K8sUtils.set(client, new FileInputStream(TARGET_KUBERNETES_GENERATED_YML_FOLDER + "keycloakrealmimports.k8s.keycloak.org-v1.yml")); + + Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS).untilAsserted(() -> client.resources(Keycloak.class).list()); + Awaitility.await().pollInterval(100, TimeUnit.MILLISECONDS).untilAsserted(() -> client.resources(KeycloakRealmImport.class).list()); } private static void registerReconcilers() { @@ -239,7 +244,7 @@ public class BaseOperatorTest implements QuarkusTestAfterEachCallback { } private static void setDefaultAwaitilityTimings() { - Awaitility.setDefaultPollInterval(Duration.ofSeconds(1)); + Awaitility.setDefaultPollInterval(Duration.ofMillis(500)); Awaitility.setDefaultTimeout(Duration.ofSeconds(360)); }