Murtadha Hubail has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1990

Change subject: [ASTERIXDB-2069][TEST] Stop NCServiceExecutionIT on UNUSABLE 
Cluster
......................................................................

[ASTERIXDB-2069][TEST] Stop NCServiceExecutionIT on UNUSABLE Cluster

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Stop executing the rest of NCServiceExecutionIT tests if waiting
  for the cluster to become ACTIVE fails.

Change-Id: I8fd470d224aeedbf9c7b0da2bc76f3fa8f0a962e
---
M 
asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/NCServiceExecutionIT.java
1 file changed, 13 insertions(+), 3 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/90/1990/1

diff --git 
a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/NCServiceExecutionIT.java
 
b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/NCServiceExecutionIT.java
index 9e51f8c..6e76b28 100644
--- 
a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/NCServiceExecutionIT.java
+++ 
b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/NCServiceExecutionIT.java
@@ -18,12 +18,16 @@
  */
 package org.apache.asterix.server.test;
 
+import static 
org.apache.asterix.common.api.IClusterManagementWork.ClusterState.ACTIVE;
+import static 
org.apache.asterix.common.api.IClusterManagementWork.ClusterState.UNUSABLE;
+
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Random;
 import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.asterix.test.common.TestExecutor;
@@ -238,21 +242,27 @@
                 case NC1:
                     LOGGER.info("Killing NC1...");
                     nc1.stop(); // we can't kill due to ASTERIXDB-1941
-                    testExecutor.waitForClusterState("UNUSABLE", 60, 
TimeUnit.SECONDS); // wait for missed heartbeats...
+                    testExecutor.waitForClusterState(UNUSABLE.name(), 60, 
TimeUnit.SECONDS); // wait for missed heartbeats...
                     nc1.start(); // this restarts the NC service
                     break;
 
                 case NC2:
                     LOGGER.info("Killing NC2...");
                     nc2.stop(); // we can't kill due to ASTERIXDB-1941
-                    testExecutor.waitForClusterState("UNUSABLE", 60, 
TimeUnit.SECONDS); // wait for missed heartbeats...
+                    testExecutor.waitForClusterState(UNUSABLE.name(), 60, 
TimeUnit.SECONDS); // wait for missed heartbeats...
                     nc2.start(); // this restarts the NC service
                     break;
 
                 default:
                     Assert.fail("killType: " + killType);
             }
-            testExecutor.waitForClusterActive(30, TimeUnit.SECONDS);
+            try {
+                testExecutor.waitForClusterActive(30, TimeUnit.SECONDS);
+            } catch (Exception e) {
+                // stop executing the rest of the tests since the cluster is 
not ACTIVE
+                LOGGER.log(Level.SEVERE, "Cannot continue since cluster is not 
" + ACTIVE.name(), e);
+                System.exit(-1);
+            }
         }
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1990
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fd470d224aeedbf9c7b0da2bc76f3fa8f0a962e
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Murtadha Hubail <[email protected]>

Reply via email to