couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject git commit: Revert an errant hunk from test/javascript/run.tpl
Date Thu, 26 Apr 2012 17:17:23 GMT
Updated Branches:
  refs/heads/master f6b97ee0c -> c2b12491a


Revert an errant hunk from test/javascript/run.tpl

Accidentally included half an idea on trying to make sure that the
CouchDB process spawned by the JS CLI tests exited.


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

Branch: refs/heads/master
Commit: c2b12491a1ee2f6e0d396d0a875489b98ec8a6cd
Parents: f6b97ee
Author: Paul Joseph Davis <davisp@apache.org>
Authored: Thu Apr 26 12:15:37 2012 -0500
Committer: Paul Joseph Davis <davisp@apache.org>
Committed: Thu Apr 26 12:17:14 2012 -0500

----------------------------------------------------------------------
 test/javascript/run.tpl |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/c2b12491/test/javascript/run.tpl
----------------------------------------------------------------------
diff --git a/test/javascript/run.tpl b/test/javascript/run.tpl
index d163f9f..267b6d0 100644
--- a/test/javascript/run.tpl
+++ b/test/javascript/run.tpl
@@ -37,15 +37,21 @@ else
     fi
 fi
 
+# stop CouchDB on exit from various signals
+abort() {
+    trap - 0
+    ./utils/run -d
+    exit 2
+}
+
 # start CouchDB
 if [ -z $COUCHDB_NO_START ]; then
         make dev
+    trap 'abort' EXIT
 	./utils/run -b -r 1 -n \
 		-a $BUILD_DIR/etc/couchdb/default_dev.ini \
 		-a $SRC_DIR/test/random_port.ini \
 		-a $BUILD_DIR/etc/couchdb/local_dev.ini
-    RUN_PID=$!
-    trap "./utils/run -d || kill $RUN_PID || exit 2" EXIT
 	sleep 1 # give it a sec
 fi
 
@@ -61,4 +67,12 @@ $COUCHJS -H -u $COUCH_URI_FILE \
 	$JS_TEST_DIR/couch_http.js \
 	$JS_TEST_DIR/cli_runner.js
 
-exit $?
+RESULT=$?
+
+if [ -z $COUCHDB_NO_START ]; then
+    # stop CouchDB
+    ./utils/run -d
+    trap - 0
+fi
+
+exit $RESULT


Mime
View raw message