jvarenina commented on a change in pull request #5182: URL: https://github.com/apache/geode/pull/5182#discussion_r437924826
########## File path: geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java ########## @@ -370,6 +377,36 @@ public void testWaitForViewInstallation() { .untilAsserted(() -> assertThat(waitForViewInstallationDone.get()).isTrue()); } + /** + * show that waitForViewInstallation works as expected when distribution manager is closed + * while waiting for the latest membership view to install + */ + @Test + public void testWaitForViewInstallationDisconnectDS() { + InternalDistributedSystem system = getSystem(); + ClusterDistributionManager dm = (ClusterDistributionManager) system.getDM(); + MembershipView<InternalDistributedMember> view = dm.getDistribution().getView(); + + CyclicBarrier cyclicBarrier = new CyclicBarrier(2); + Future future = executorService.submit(() -> { + try { + cyclicBarrier.await(getTimeout().toMillis(), TimeUnit.MILLISECONDS); + dm.waitForViewInstallation(view.getViewId() + 1); + } catch (InterruptedException | BrokenBarrierException | TimeoutException e) { + errorCollector.addError(e); + } + }); + + try { + cyclicBarrier.await(getTimeout().toMillis(), TimeUnit.MILLISECONDS); + system.disconnect(); + future.get(getTimeout().toMillis(), TimeUnit.MILLISECONDS); + } catch (InterruptedException | TimeoutException | ExecutionException Review comment: You are right! Done. ---------------------------------------------------------------- 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: us...@infra.apache.org