summaryrefslogtreecommitdiff
path: root/share/www/script/couch_test_runner.js
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2011-09-08 05:00:10 +0000
committerPaul Joseph Davis <davisp@apache.org>2011-09-08 05:00:10 +0000
commit71081311b2b11ed923869ce5bd11ce7b0fd1da2c (patch)
tree85c5613959f8435e4b3de922765b01ecb945477d /share/www/script/couch_test_runner.js
parent61ca44e384ca10b0b7bf68123c79ed43715ea9c9 (diff)
Fix CouchJS compatibility with older SpiderMonkey.
This is a backport of the work to make CouchJS build against all of the major versions of SpiderMonkey. Thanks to Randall Leeds and Chris Coulson for the original patches. Backport based on r1137464 and r1164346 Fixes COUCHDB-1078 Fixes COUCHDB-1260 git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1166525 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/couch_test_runner.js')
-rw-r--r--share/www/script/couch_test_runner.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
index 55a6533f..e14640b6 100644
--- a/share/www/script/couch_test_runner.js
+++ b/share/www/script/couch_test_runner.js
@@ -414,9 +414,22 @@ function waitForSuccess(fun, tag) {
function waitForRestart() {
var waiting = true;
- while (waiting) {
+ // Wait for the server to go down but don't
+ // wait too long because we might miss the
+ // unavailable period.
+ var count = 25;
+ while (waiting && count > 0) {
+ count--;
try {
CouchDB.request("GET", "/");
+ } catch(e) {
+ waiting = false;
+ }
+ }
+ // Wait for it to come back up
+ waiting = true;
+ while (waiting) {
+ try {
CouchDB.request("GET", "/");
waiting = false;
} catch(e) {