Skip to content

Commit

Permalink
Add extra wait to avoid intermittent failures in OwnershipCacheTest (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
merlimat authored Jun 20, 2017
1 parent e87d5f8 commit 02128c6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ public void testGetOwnedServiceUnit() throws Exception {
} catch (NullPointerException npe) {
// OK for not owned namespace
}

Thread.sleep(500);

// try to acquire, which will load the read-only cache
NamespaceEphemeralData data1 = cache.tryAcquiringOwnership(testBundle).get();
assertEquals(data1.getNativeUrl(), "pulsar://otherhost:8881");
Expand Down Expand Up @@ -238,6 +241,9 @@ public void testGetOwnedServiceUnits() throws Exception {
new NamespaceEphemeralData("pulsar://otherhost:8881", "pulsar://otherhost:8884",
"http://otherhost:8080", "https://otherhost:4443", false));
assertTrue(cache.getOwnedBundles().isEmpty());

Thread.sleep(500);

// try to acquire, which will load the read-only cache
NamespaceEphemeralData data1 = cache.tryAcquiringOwnership(testBundle).get();
assertEquals(data1.getNativeUrl(), "pulsar://otherhost:8881");
Expand Down

0 comments on commit 02128c6

Please sign in to comment.