You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2012/01/23 00:43:13 UTC

[20/50] git commit: improve the startup delay for js test harness

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.


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

Branch: refs/heads/COUCHDB-1342
Commit: 2e60492716658da175f499340678189e1213254c
Parents: 2921c78
Author: Randall Leeds <ra...@apache.org>
Authored: Thu Dec 15 19:49:55 2011 -0800
Committer: Randall Leeds <ra...@apache.org>
Committed: Sat Jan 7 16:55:24 2012 -0800

----------------------------------------------------------------------
 share/www/script/couch_test_runner.js |    4 +++-
 test/javascript/cli_runner.js         |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/2e604927/share/www/script/couch_test_runner.js
----------------------------------------------------------------------
diff --git a/share/www/script/couch_test_runner.js b/share/www/script/couch_test_runner.js
index c1e7a72..d1a53e9 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) {}
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/couchdb/blob/2e604927/test/javascript/cli_runner.js
----------------------------------------------------------------------
diff --git a/test/javascript/cli_runner.js b/test/javascript/cli_runner.js
index cdbe2e7..6683ede 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());