This is an automated email from the ASF dual-hosted git repository.
dengliming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new 6c6bf31 fix
"org.apache.shenyu.loadbalancer.cache.UpstreamCheckTaskTest.testRun test
fail"(#2128) (#2146)
6c6bf31 is described below
commit 6c6bf312a145467202a3d94973c35eb224e95d43
Author: kevinBobo <[email protected]>
AuthorDate: Mon Sep 27 11:15:14 2021 +0800
fix "org.apache.shenyu.loadbalancer.cache.UpstreamCheckTaskTest.testRun
test fail"(#2128) (#2146)
Co-authored-by: hanyabo <[email protected]>
---
.../org/apache/shenyu/loadbalancer/cache/UpstreamCheckTaskTest.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/shenyu-loadbalancer/src/test/java/org/apache/shenyu/loadbalancer/cache/UpstreamCheckTaskTest.java
b/shenyu-loadbalancer/src/test/java/org/apache/shenyu/loadbalancer/cache/UpstreamCheckTaskTest.java
index ba43a52..11bd9ef 100644
---
a/shenyu-loadbalancer/src/test/java/org/apache/shenyu/loadbalancer/cache/UpstreamCheckTaskTest.java
+++
b/shenyu-loadbalancer/src/test/java/org/apache/shenyu/loadbalancer/cache/UpstreamCheckTaskTest.java
@@ -75,7 +75,7 @@ public class UpstreamCheckTaskTest {
healthCheckTask.schedule();
// Wait for the upstream-health-check thread to start.
Awaitility.await().pollDelay(3, TimeUnit.SECONDS).untilAsserted(() ->
assertFalse(healthCheckTask.getCheckStarted().get()));
-
assertTrue(healthCheckTask.getHealthyUpstream().containsKey(selectorId1));
+
assertTrue(healthCheckTask.getUnhealthyUpstream().get(selectorId1).size() > 0);
// Let it coverage line 151~163
when(upstream.isHealthy()).thenReturn(false).thenReturn(true);
// Even if the address could not connect, it will return false, that
mean it will not coverage 151~163.
@@ -83,7 +83,7 @@ public class UpstreamCheckTaskTest {
// Manually run one time
healthCheckTask.run();
Awaitility.await().pollDelay(1, TimeUnit.SECONDS).untilAsserted(() ->
assertFalse(healthCheckTask.getCheckStarted().get()));
-
assertTrue(healthCheckTask.getUnhealthyUpstream().containsKey(selectorId1));
+
assertTrue(healthCheckTask.getHealthyUpstream().get(selectorId1).size() > 0);
}
/**