summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Leeds <randall@apache.org>2011-12-15 19:49:55 -0800
committerRandall Leeds <randall@apache.org>2012-01-07 16:55:24 -0800
commit2e60492716658da175f499340678189e1213254c (patch)
tree3a2fb60c2f04fe2a54869a8efcf7c82bc93cea18
parent2921c7869411f338da036f893f5937178d1e823c (diff)
downloadcouchdb-2e60492716658da175f499340678189e1213254c.tar.gz
improve the startup delay for js test harness
Change waitForSuccess to catch errors in the sync request that's used to hand control back to the JS engine. Then, use waitForSuccess to see if CouchDB has started and remove the 1 second sleep before the tests start.
-rw-r--r--share/www/script/couch_test_runner.js4
-rw-r--r--test/javascript/cli_runner.js1
2 files changed, 4 insertions, 1 deletions
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
index c1e7a72bd..d1a53e91e 100644
--- a/share/www/script/couch_test_runner.js
+++ b/share/www/script/couch_test_runner.js
@@ -412,7 +412,9 @@ function waitForSuccess(fun, tag) {
break;
} catch (e) {}
// sync http req allow async req to happen
- CouchDB.request("GET", "/test_suite_db/?tag="+encodeURIComponent(tag));
+ try {
+ CouchDB.request("GET", "/test_suite_db/?tag="+encodeURIComponent(tag));
+ } catch (e) {}
}
}
}
diff --git a/test/javascript/cli_runner.js b/test/javascript/cli_runner.js
index cdbe2e73d..6683edef9 100644
--- a/test/javascript/cli_runner.js
+++ b/test/javascript/cli_runner.js
@@ -46,6 +46,7 @@ function runAllTestsConsole() {
};
try {
+ waitForSuccess(CouchDB.getVersion);
runAllTestsConsole();
} catch (e) {
p("# " + e.toString());