diff options
author | Damien F. Katz <damien@apache.org> | 2010-04-02 23:17:02 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2010-04-02 23:17:02 +0000 |
commit | 8897dbe40941295009d156bf77eb0bf40abc5136 (patch) | |
tree | 46c2d859e2baa93190f4c8757f8ffa880de2f07f /share/www/script/test/stats.js | |
parent | 776b36073865dc66a7834beabf3074b32d9669a1 (diff) |
Removed _sleep from all tests. replaced with loops that spin until a condition is true. Makes tests faster and less likely to fail sporadically.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@930430 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/stats.js')
-rw-r--r-- | share/www/script/test/stats.js | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/share/www/script/test/stats.js b/share/www/script/test/stats.js index 793b390d..23468a37 100644 --- a/share/www/script/test/stats.js +++ b/share/www/script/test/stats.js @@ -81,19 +81,17 @@ couchTests.stats = function(debug) { var pre_dbs = getStat("couchdb", "open_databases").current || 0; var pre_files = getStat("couchdb", "open_os_files").current || 0; - // We have to make sure that as we open the max'th database - // that we've waited for more than 1 second since opening - // the first database so that any delayed commits will be - // flushed. var triggered = false; var db = null; for(var i = 0; i < max*2; i++) { - try { - db = newDb("test_suite_db_" + i, true); - } catch(e) { - triggered = true; - CouchDB.request("GET", "/_sleep?time=1500"); - db = newDb("test_suite_db_" + i, true); + while (true) { + try { + db = newDb("test_suite_db_" + i, true); + break; + } catch(e) { + // all_dbs_active error! + triggered = true; + } } // Trigger a delayed commit |