From a03fd4c3f8797d8f4f4ebb172a3c59edc4f69262 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Fri, 20 Mar 2020 14:43:47 -0400 Subject: [PATCH 1/3] Fixes issue --- .../core/HealthCheckServiceInstanceListSupplierTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java b/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java index 2b3a84f7..be957814 100644 --- a/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java +++ b/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java @@ -467,7 +467,7 @@ class HealthCheckServiceInstanceListSupplierTests { Assertions.assertThat(emitCounter).hasValue(1); } - @Ignore // Fixme: see https://github.com/spring-cloud/spring-cloud-gateway/issues/1627 + @Ignore // Fixme: see https://github.com/spring-cloud/spring-cloud-commons/issues/716 @Test void shouldCancelSubscription() { From de9882ced9baf150e6498629488fae8c7642f069 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Fri, 20 Mar 2020 15:19:51 -0400 Subject: [PATCH 2/3] Ignores failing test because of old boot version. see gh-717 --- .../cloud/configuration/SpringBootDependencyTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java b/spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java index 0127b8ec..16efe0ef 100644 --- a/spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java +++ b/spring-cloud-commons/src/test/java/org/springframework/cloud/configuration/SpringBootDependencyTests.java @@ -19,6 +19,7 @@ package org.springframework.cloud.configuration; import java.util.Collections; import java.util.List; +import org.junit.Ignore; import org.junit.Test; import static org.assertj.core.api.BDDAssertions.then; @@ -142,6 +143,7 @@ public class SpringBootDependencyTests { then(verificationResult.action).isNotEmpty(); } + @Ignore // FIXME: https://github.com/spring-cloud/spring-cloud-commons/issues/717 @Test public void should_match_against_current_manifest() { verifyCurrentVersionFromManifest("2.3"); From 0e3ea3397d4550ce34818c20d7cf2de63176b9dd Mon Sep 17 00:00:00 2001 From: robotmrv Date: Wed, 25 Mar 2020 20:36:45 +0200 Subject: [PATCH 3/3] try to fix flaky test (#718) fixes gh-716 --- ...hCheckServiceInstanceListSupplierTests.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java b/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java index be957814..5b48802a 100644 --- a/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java +++ b/spring-cloud-loadbalancer/src/test/java/org/springframework/cloud/loadbalancer/core/HealthCheckServiceInstanceListSupplierTests.java @@ -18,12 +18,12 @@ package org.springframework.cloud.loadbalancer.core; import java.time.Duration; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.assertj.core.api.Assertions; import org.assertj.core.util.Lists; import org.awaitility.Awaitility; -import org.junit.Ignore; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -467,27 +467,31 @@ class HealthCheckServiceInstanceListSupplierTests { Assertions.assertThat(emitCounter).hasValue(1); } - @Ignore // Fixme: see https://github.com/spring-cloud/spring-cloud-commons/issues/716 @Test void shouldCancelSubscription() { final AtomicInteger instancesCanceled = new AtomicInteger(); - + final AtomicBoolean subscribed = new AtomicBoolean(); ServiceInstanceListSupplier delegate = Mockito .mock(ServiceInstanceListSupplier.class); - Mockito.when(delegate.get()).thenReturn(Flux.>never() - .log("test").doOnCancel(instancesCanceled::incrementAndGet)); + Mockito.when(delegate.get()) + .thenReturn(Flux.>never() + .doOnSubscribe(subscription -> subscribed.set(true)) + .doOnCancel(instancesCanceled::incrementAndGet)); listSupplier = new HealthCheckServiceInstanceListSupplier(delegate, healthCheck, webClient); listSupplier.afterPropertiesSet(); + Awaitility.await("delegate subscription").pollDelay(Duration.ofMillis(50)) + .atMost(VERIFY_TIMEOUT).untilTrue(subscribed); + Assertions.assertThat(instancesCanceled).hasValue(0); listSupplier.destroy(); - Awaitility.await().pollDelay(Duration.ofMillis(100)).atMost(VERIFY_TIMEOUT) - .untilAsserted( + Awaitility.await("delegate cancellation").pollDelay(Duration.ofMillis(100)) + .atMost(VERIFY_TIMEOUT).untilAsserted( () -> Assertions.assertThat(instancesCanceled).hasValue(1)); }