summaryrefslogtreecommitdiff
path: root/rel/overlay/share/www/script/couch_test_runner.js
diff options
context:
space:
mode:
Diffstat (limited to 'rel/overlay/share/www/script/couch_test_runner.js')
-rw-r--r--rel/overlay/share/www/script/couch_test_runner.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/rel/overlay/share/www/script/couch_test_runner.js b/rel/overlay/share/www/script/couch_test_runner.js
index 55a6533f..e14640b6 100644
--- a/rel/overlay/share/www/script/couch_test_runner.js
+++ b/rel/overlay/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) {