Repository: incubator-geode
Updated Branches:
  refs/heads/develop afc5dde7a -> 0014fd444


GEODE-1407: CI Failure: ReconnectDUnitTest.testReconnectALocator

Added a FlakyTest annotation to the test.  Modified the flaky runnable
to use fail() instead of logging symptoms so that we can tell more about
why it's flaky.

The test never fails when run by itself so it may be an infection from
another test.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0014fd44
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0014fd44
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0014fd44

Branch: refs/heads/develop
Commit: 0014fd444332ba05b55c95ce1d220613dbe9d580
Parents: afc5dde
Author: Bruce Schuchardt <bschucha...@pivotal.io>
Authored: Fri May 20 13:51:40 2016 -0700
Committer: Bruce Schuchardt <bschucha...@pivotal.io>
Committed: Fri May 20 13:55:03 2016 -0700

----------------------------------------------------------------------
 .../gemfire/cache30/ReconnectDUnitTest.java     | 21 +++++++++-----------
 1 file changed, 9 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0014fd44/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git 
a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java 
b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
index 6c63def..948e75a 100755
--- 
a/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
+++ 
b/geode-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java
@@ -36,6 +36,8 @@ import com.gemstone.gemfire.internal.AvailablePortHelper;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator;
 import com.gemstone.gemfire.test.dunit.*;
+import com.gemstone.gemfire.test.junit.categories.FlakyTest;
+import org.junit.experimental.categories.Category;
 
 import java.io.File;
 import java.io.FileWriter;
@@ -452,7 +454,8 @@ public class ReconnectDUnitTest extends CacheTestCase
     });
   }
   
-  
+
+  @Category(FlakyTest.class) // GEODE-1407
   public void testReconnectALocator() throws Exception {
     Host host = Host.getHost(0);
     VM vm0 = host.getVM(0);
@@ -523,8 +526,8 @@ public class ReconnectDUnitTest extends CacheTestCase
       newdm = waitForReconnect(vm0);
       assertGfshWaitingThreadAlive(vm0);
 
-      boolean running = (Boolean)vm0.invoke(new SerializableCallable("check 
for running locator") {
-        public Object call() {
+      vm0.invoke(new SerializableRunnable("check for running locator") {
+        public void run() {
           WaitCriterion wc = new WaitCriterion() {
             public boolean done() {
               return Locator.getLocator() != null;
@@ -535,20 +538,14 @@ public class ReconnectDUnitTest extends CacheTestCase
           };
           Wait.waitForCriterion(wc, 30000, 1000, false);
           if (Locator.getLocator() == null) {
-            LogWriterUtils.getLogWriter().error("expected to find a running 
locator but getLocator() returns null");
-            return false;
+            fail("expected to find a running locator but getLocator() returns 
null");
           }
           if (((InternalLocator)Locator.getLocator()).isStopped()) {
-            LogWriterUtils.getLogWriter().error("found a stopped locator");
-            return false;
+            fail("found a stopped locator");
           }
-          return true;
         }
       });
-      if (!running) {
-        fail("expected the restarted member to be hosting a running locator");
-      }
-      
+
       assertNotSame("expected a reconnect to occur in the locator", dm, newdm);
 
       // the log should have been opened and appended with a new view

Reply via email to