Skip to content

Commit ab421f7

Browse files
committed
test(admin): await recorded master selection failures
1 parent 6fa0abc commit ab421f7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎shenyu-admin/src/test/java/org/apache/shenyu/admin/mode/cluster/service/ShenyuClusterServiceTest.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import java.util.concurrent.TimeUnit;
3838
import java.util.concurrent.atomic.AtomicInteger;
3939

40+
import static org.awaitility.Awaitility.await;
4041
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
4142
import static org.junit.jupiter.api.Assertions.assertEquals;
4243
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -234,7 +235,7 @@ public void testSelectMasterErrorCountTracking() throws Exception {
234235

235236
clusterService.start("127.0.0.1", 9195, "/shenyu");
236237
assertTrue(errorsOccurred.await(5, TimeUnit.SECONDS));
237-
assertTrue(clusterService.getSelectMasterErrorCount() >= 2);
238+
await().atMost(AWAIT_MILLIS, TimeUnit.MILLISECONDS).untilAsserted(() -> assertTrue(clusterService.getSelectMasterErrorCount() >= 2));
238239

239240
clusterService.shutdown();
240241
}

0 commit comments

Comments
 (0)