[Flaky-test]: AdminApiTest.testNamespaceSplitBundleConcurrent
@@ -1533,10 +1533,11 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
fail("split bundle shouldn't have thrown exception");
}
+ Awaitility.await().untilAsserted(() ->
+ assertEquals(bundleFactory.getBundles(NamespaceName.get(namespace)).getBundles().size(), 4));
String[] splitRange4 = { namespace + "/0x00000000_0x3fffffff", namespace + "/0x3fffffff_0x7fffffff",
namespace + "/0x7fffffff_0xbfffffff", namespace + "/0xbfffffff_0xffffffff" };
bundles = bundleFactory.getBundles(NamespaceName.get(namespace));
- assertEquals(bundles.getBundles().size(), 4);
for (int i = 0; i < bundles.getBundles().size(); i++) {
assertEquals(bundles.getBundles().get(i).toString(), splitRange4[i]);
}
@@ -1566,13 +1567,13 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
} catch (Exception e) {
fail("split bundle shouldn't have thrown exception");
}
-
+ Awaitility.await().untilAsserted(() ->
+ assertEquals(bundleFactory.getBundles(NamespaceName.get(namespace)).getBundles().size(), 8));
String[] splitRange8 = { namespace + "/0x00000000_0x1fffffff", namespace + "/0x1fffffff_0x3fffffff",
namespace + "/0x3fffffff_0x5fffffff", namespace + "/0x5fffffff_0x7fffffff",
namespace + "/0x7fffffff_0x9fffffff", namespace + "/0x9fffffff_0xbfffffff",
namespace + "/0xbfffffff_0xdfffffff", namespace + "/0xdfffffff_0xffffffff" };
bundles = bundleFactory.getBundles(NamespaceName.get(namespace));
- assertEquals(bundles.getBundles().size(), 8);
for (int i = 0; i < bundles.getBundles().size(); i++) {
assertEquals(bundles.getBundles().get(i).toString(), splitRange8[i]);
}
