Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.
  • Loading branch information...
commit c2b12491a1ee2f6e0d396d0a875489b98ec8a6cd 1 parent f6b97ee
Paul J. Davis authored

Showing 1 changed file with 17 additions and 3 deletions. Show diff stats Hide diff stats

  1. 20  test/javascript/run.tpl
20  test/javascript/run.tpl
@@ -37,15 +37,21 @@ else
37 37
     fi
38 38
 fi
39 39
 
  40
+# stop CouchDB on exit from various signals
  41
+abort() {
  42
+    trap - 0
  43
+    ./utils/run -d
  44
+    exit 2
  45
+}
  46
+
40 47
 # start CouchDB
41 48
 if [ -z $COUCHDB_NO_START ]; then
42 49
         make dev
  50
+    trap 'abort' EXIT
43 51
 	./utils/run -b -r 1 -n \
44 52
 		-a $BUILD_DIR/etc/couchdb/default_dev.ini \
45 53
 		-a $SRC_DIR/test/random_port.ini \
46 54
 		-a $BUILD_DIR/etc/couchdb/local_dev.ini
47  
-    RUN_PID=$!
48  
-    trap "./utils/run -d || kill $RUN_PID || exit 2" EXIT
49 55
 	sleep 1 # give it a sec
50 56
 fi
51 57
 
@@ -61,4 +67,12 @@ $COUCHJS -H -u $COUCH_URI_FILE \
61 67
 	$JS_TEST_DIR/couch_http.js \
62 68
 	$JS_TEST_DIR/cli_runner.js
63 69
 
64  
-exit $?
  70
+RESULT=$?
  71
+
  72
+if [ -z $COUCHDB_NO_START ]; then
  73
+    # stop CouchDB
  74
+    ./utils/run -d
  75
+    trap - 0
  76
+fi
  77
+
  78
+exit $RESULT

0 notes on commit c2b1249

Please sign in to comment.
Something went wrong with that request. Please try again.