From 35d22b8cd4a5cd7809d906adbfed561a9705a101 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Tue, 19 Jan 2021 11:05:02 -0500 Subject: [PATCH] Add some resiliency to tests --- .../configuration/watcher/ActuatorRefreshRabbitMQIT.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/ActuatorRefreshRabbitMQIT.java b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/ActuatorRefreshRabbitMQIT.java index 442d0704..9ae3d3d4 100644 --- a/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/ActuatorRefreshRabbitMQIT.java +++ b/spring-cloud-kubernetes-integration-tests/spring-cloud-kubernetes-configuration-watcher-it/src/test/java/org/springframework/cloud/kubernetes/configuration/watcher/ActuatorRefreshRabbitMQIT.java @@ -100,6 +100,12 @@ public class ActuatorRefreshRabbitMQIT { .build(); api.createNamespacedConfigMap(NAMESPACE, configMap, null, null, null); RestTemplate rest = new RestTemplateBuilder().build(); + + // Sometimes the NGINX ingress takes a bit to catch up and realize the service is + // available and we get a 503, we just need to wait a bit + await().timeout(Duration.ofSeconds(60)) + .until(() -> rest.getForEntity("http://localhost:80/it", Boolean.class).getStatusCode().is2xxSuccessful()); + // Wait a bit before we verify await().pollInterval(Duration.ofSeconds(1)).atMost(Duration.ofSeconds(90)).until(() -> { Boolean value = rest.getForObject("http://localhost:80/it", Boolean.class);