From 89f99e4873d9872cef164fb83c5b242a1f4f646c Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Wed, 12 May 2021 20:47:19 +0300 Subject: [PATCH] Fix flaky test SimpleProducerConsumerTest.testActiveAndInActiveConsumerEntryCacheBehavior (#10556) Fixes #10555 --- .../apache/pulsar/client/api/SimpleProducerConsumerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java index 0e1c519a41c68..2ddb400b91f6b 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java @@ -1028,7 +1028,7 @@ public void testActiveAndInActiveConsumerEntryCacheBehavior() throws Exception { msg = subscriber1.receive(RECEIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS); // Verify: as active-subscriber2 has not consumed messages: EntryCache must have those entries in cache - assertTrue(entryCache.getSize() != 0); + Awaitility.await().untilAsserted(() -> assertNotEquals(entryCache.getSize(), 0)); // 3.b Close subscriber2: which will trigger cache to clear the cache subscriber2.close();