Bill commented on a change in pull request #5598:
URL: https://github.com/apache/geode/pull/5598#discussion_r501145984
##########
File path:
geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MembershipIntegrationTest.java
##########
@@ -272,6 +276,65 @@ public void secondMembershipPausesForLocatorWaitTime()
stop(coordinatorLocator, lateJoiningLocator);
}
+ @Test
+ public void locatorsStopWaitingForLocatorWaitTimeIfAllLocatorsContacted()
+ throws IOException, MemberStartupException, InterruptedException,
TimeoutException,
+ ExecutionException {
+
+ final Supplier<ExecutorService> executorServiceSupplier =
+ () -> LoggingExecutors.newCachedThreadPool("membership", false);
+
+ int[] locatorPorts = AvailablePortHelper.getRandomAvailableTCPPorts(2);
+
+ int locatorWaitTime = (int) Duration.ofMinutes(5).getSeconds();
+ final MembershipConfig config =
+ createMembershipConfig(true, locatorWaitTime, locatorPorts[0],
locatorPorts[1]);
+
+ CompletableFuture<Membership<MemberIdentifier>> createMembership0 =
+ launchLocator(executorServiceSupplier, locatorPorts[0], config);
+
+ // Assert that membership 0 is waiting for the other locator to start
+ Thread.sleep(5000);
+ assertThat(createMembership0.getNow(null)).isNull();
+
+ CompletableFuture<Membership<MemberIdentifier>> createMembership1 =
+ launchLocator(executorServiceSupplier, locatorPorts[1], config);
+
+ // Make sure the members are created in less than the locator-wait-time
+ Membership<MemberIdentifier> membership0 = createMembership0.get(2,
TimeUnit.MINUTES);
+ Membership<MemberIdentifier> membership1 = createMembership1.get(2,
TimeUnit.MINUTES);
+
+ // Make sure the members see each other in the view
+ assertThat(membership0.getView().getMembers()).hasSize(2);
+ assertThat(membership1.getView().getMembers()).hasSize(2);
+ }
Review comment:
Ok @upthewaterspout. After this PR merges I'll write a ticket to make
this improvement. Thanks for trying it though!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]