Repository: asterixdb
Updated Branches:
  refs/heads/master f40081f5a -> 35a376ab0


Wait For NC Processes To Exit Before Sanity Check

Wait for NCService / NCDriver processes to exit (or timeout to exhaust)
before checking for extraneous processes.  Otherwise, a false-positive
may be reported.

Change-Id: I35ebad976fa49d308843aee784ceacff5850bd11
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1348
Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>
Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/35a376ab
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/35a376ab
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/35a376ab

Branch: refs/heads/master
Commit: 35a376ab0e630a09c077f05d4e745d69e553ed26
Parents: f40081f
Author: Michael Blow <mb...@apache.org>
Authored: Thu Nov 10 16:24:58 2016 -0500
Committer: Michael Blow <mb...@apache.org>
Committed: Thu Nov 10 18:33:33 2016 -0800

----------------------------------------------------------------------
 .../src/main/samples/local/bin/stop-sample-cluster.bat      | 9 +++++++--
 .../src/main/samples/local/bin/stop-sample-cluster.sh       | 6 +++++-
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/35a376ab/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.bat
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.bat 
b/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.bat
index 0971065..7ac9483 100644
--- 
a/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.bat
+++ 
b/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.bat
@@ -89,9 +89,9 @@ echo INFO: Waiting up for cluster to shutdown...
 set tries=0
 :wait_loop
 set /A tries=%tries% + 1
-if "%tries%" == "60" goto :post_shutdown
+if "%tries%" == "60" goto :timed_out
 wmic process where ^
-  "name='java.exe' and CommandLine like 
'%%org.codehaus.mojo.appassembler.booter.AppassemblerBooter%%' and CommandLine 
like '%%app.name=\"%%cc\"%%'" ^
+  "name='java.exe' and CommandLine like 
'%%org.codehaus.mojo.appassembler.booter.AppassemblerBooter%%' and (CommandLine 
like '%%app.name=\"%%[cn]c\"%%' or CommandLine like 
'%%app.name=\"%%ncservice\"%%')" ^
   GET processid >%tempfile% 2>/dev/null
 
 set found=
@@ -100,6 +100,11 @@ if "%found%" == "1" (
   timeout /T 1 /NOBREAK >/dev/null
   goto :wait_loop
 )
+goto :post_shutdown
+
+:timed_out
+echo timed out!
+
 :post_shutdown
 echo.
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/35a376ab/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.sh
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.sh 
b/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.sh
index f6824c8..7ee5fdf 100755
--- a/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/samples/local/bin/stop-sample-cluster.sh
@@ -62,7 +62,11 @@ if [ $? -ne 1 ]; then
   first=1
   tries=0
   echo -n "INFO: Waiting up to 60s for cluster to shutdown"
-  while [ -n "$($JAVA_HOME/bin/jps | awk '/CCDriver/')" -a $tries -lt 60 ]; do
+  while [ -n "$($JAVA_HOME/bin/jps | awk '/ (CCDriver|NCDriver|NCService)$/')" 
]; do
+    if [ $tries -ge 60 ]; then
+      echo "...timed out!"
+      break
+    fi
     sleep 1s
     echo -n .
     tries=$(expr $tries + 1)

Reply via email to