[ https://issues.apache.org/jira/browse/GEODE-2653?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15951514#comment-15951514 ]
ASF GitHub Bot commented on GEODE-2653: --------------------------------------- GitHub user galen-pivotal opened a pull request: https://github.com/apache/geode/pull/437 GEODE-2653: Fix testRemoveMember and remove FlakyTest. And do some cleanup while I'm here: * Change Mockito's `any` to `isA`. * Replace some `Thread.sleep()` calls with Awaitility calls. * Remove our `MethodExecuted` class -- this can be done with Mockito's`verify()`. You can merge this pull request into a Git repository by running: $ git pull https://github.com/galen-pivotal/geode feature/GEODE-2653 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/geode/pull/437.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #437 ---- commit 6ffdee107a000d781c37f9b924b5e56197fbec06 Author: Galen OSullivan <gosulli...@pivotal.io> Date: 2017-03-31T18:44:54Z GEODE-2653: Fix testRemoveMember and remove FlakyTest. Test removed self instead of the other member, and used the `any` matcher instead of `isA`. commit f0dfd1fc2b468b0482a08726df3b587da05d7102 Author: Galen OSullivan <gosulli...@pivotal.io> Date: 2017-03-31T19:07:23Z Cleanup GMSJoinLeaveJUnitTest. * Change Mockito's `any` to `isA`. * Replace some `Thread.sleep()` calls with Awaitility calls. * Remove our `MethodExecuted` class -- this can be done with Mockito's `verify()`. ---- > GMSJoinLeaveJUnitTest.testRemoveMember fails with AssertionError > ---------------------------------------------------------------- > > Key: GEODE-2653 > URL: https://issues.apache.org/jira/browse/GEODE-2653 > Project: Geode > Issue Type: Bug > Components: membership, tests > Reporter: Kirk Lund > Assignee: Galen O'Sullivan > Labels: Flaky > > Intermittent failure stack: > {noformat} > org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeaveJUnitTest > > testRemoveMember FAILED > java.lang.AssertionError > at org.junit.Assert.fail(Assert.java:86) > at org.junit.Assert.assertTrue(Assert.java:41) > at org.junit.Assert.assertTrue(Assert.java:52) > at > org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeaveJUnitTest.testRemoveMember(GMSJoinLeaveJUnitTest.java:337) > {noformat} > This test looks like it's flaky due to the Thread sleep: > {noformat} > @Test > public void testRemoveMember() throws Exception { > initMocks(); > prepareAndInstallView(mockMembers[0], createMemberList(mockMembers[0], > gmsJoinLeaveMemberId)); > MethodExecuted removeMessageSent = new MethodExecuted(); > > when(messenger.send(any(RemoveMemberMessage.class))).thenAnswer(removeMessageSent); > gmsJoinLeave.remove(mockMembers[0], "removing for test"); > Thread.sleep(ServiceConfig.MEMBER_REQUEST_COLLECTION_INTERVAL * 2); > assertTrue(removeMessageSent.methodExecuted); > } > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)