Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 56A16200CAD for ; Wed, 28 Jun 2017 19:42:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 559BA160BD9; Wed, 28 Jun 2017 17:42:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 992BE160BF7 for ; Wed, 28 Jun 2017 19:42:46 +0200 (CEST) Received: (qmail 94789 invoked by uid 500); 28 Jun 2017 17:42:45 -0000 Mailing-List: contact commits-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list commits@geode.apache.org Received: (qmail 94780 invoked by uid 99); 28 Jun 2017 17:42:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2017 17:42:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 996DCDFAB0; Wed, 28 Jun 2017 17:42:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bschuchardt@apache.org To: commits@geode.apache.org Message-Id: <7162ff1688194994bf84598ff59278b6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: geode git commit: GEODE-3052 Restarting 2 locators together causes potential locator split brain Date: Wed, 28 Jun 2017 17:42:45 +0000 (UTC) archived-at: Wed, 28 Jun 2017 17:42:47 -0000 Repository: geode Updated Branches: refs/heads/develop d08a75bed -> 0254a60f5 GEODE-3052 Restarting 2 locators together causes potential locator split brain The fix for this issue introduced different timing in GMSJoinLeave's discovery process that affected one of the unit tests for that class, causing periodic failures. I've added an Awaitility.await() to stabilize the test. Project: http://git-wip-us.apache.org/repos/asf/geode/repo Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/0254a60f Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/0254a60f Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/0254a60f Branch: refs/heads/develop Commit: 0254a60f5939b537284aba4a59a7cff4da5f3fc4 Parents: d08a75b Author: Bruce Schuchardt Authored: Wed Jun 28 10:39:58 2017 -0700 Committer: Bruce Schuchardt Committed: Wed Jun 28 10:39:58 2017 -0700 ---------------------------------------------------------------------- .../gms/membership/GMSJoinLeaveJUnitTest.java | 43 +++++++++----------- 1 file changed, 20 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/geode/blob/0254a60f/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java ---------------------------------------------------------------------- diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java index a31fa8d..2c7f9d9 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java @@ -1196,29 +1196,26 @@ public class GMSJoinLeaveJUnitTest { @Test public void testCoordinatorFindRequestSuccess() throws Exception { - try { - initMocks(false); - HashSet registrants = new HashSet<>(); - registrants.add(mockMembers[0]); - FindCoordinatorResponse fcr = new FindCoordinatorResponse(mockMembers[0], mockMembers[0], - false, null, registrants, false, true, null); - NetView view = createView(); - JoinResponseMessage jrm = new JoinResponseMessage(mockMembers[0], view, 0); - - TcpClientWrapper tcpClientWrapper = mock(TcpClientWrapper.class); - gmsJoinLeave.setTcpClientWrapper(tcpClientWrapper); - FindCoordinatorRequest fcreq = - new FindCoordinatorRequest(gmsJoinLeaveMemberId, new HashSet<>(), -1, null, 0, ""); - int connectTimeout = (int) services.getConfig().getMemberTimeout() * 2; - when(tcpClientWrapper.sendCoordinatorFindRequest(new InetSocketAddress("localhost", 12345), - fcreq, connectTimeout)).thenReturn(fcr); - callAsnyc(() -> { - gmsJoinLeave.installView(view); - }); - assertTrue("Should be able to join ", gmsJoinLeave.join()); - } finally { - - } + initMocks(false); + HashSet registrants = new HashSet<>(); + registrants.add(mockMembers[0]); + FindCoordinatorResponse fcr = new FindCoordinatorResponse(mockMembers[0], mockMembers[0], + false, null, registrants, false, true, null); + NetView view = createView(); + JoinResponseMessage jrm = new JoinResponseMessage(mockMembers[0], view, 0); + + TcpClientWrapper tcpClientWrapper = mock(TcpClientWrapper.class); + gmsJoinLeave.setTcpClientWrapper(tcpClientWrapper); + FindCoordinatorRequest fcreq = + new FindCoordinatorRequest(gmsJoinLeaveMemberId, new HashSet<>(), -1, null, 0, ""); + int connectTimeout = (int) services.getConfig().getMemberTimeout() * 2; + when(tcpClientWrapper.sendCoordinatorFindRequest(new InetSocketAddress("localhost", 12345), + fcreq, connectTimeout)).thenReturn(fcr); + callAsnyc(() -> { + gmsJoinLeave.installView(view); + }); + Awaitility.await().atMost(10, TimeUnit.SECONDS).until (() -> + assertTrue("Should be able to join ", gmsJoinLeave.join())); } private void callAsnyc(Runnable run) {