summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-11-25 22:39:23 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-11-25 22:39:23 +0000
commit03ec23ec19c5b1b9b865f26c6680a5327706a6c8 (patch)
treeebc381e9f389e82efb506d4cd0d71f628c8d2100 /share
parent6f3bde270c686403d7b0434e84d37cb8fed405b2 (diff)
Fixed a bug preventing active_dbs from working.
Thanks Jeff Macdonald for the report. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@884315 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r--share/www/script/test/stats.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/share/www/script/test/stats.js b/share/www/script/test/stats.js
index cf2581e9..6e37e741 100644
--- a/share/www/script/test/stats.js
+++ b/share/www/script/test/stats.js
@@ -80,9 +80,24 @@ couchTests.stats = function(debug) {
var testFun = function() {
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 times = [];
for(var i = 0; i < max*2; i++) {
- newDb("test_suite_db_" + i, true);
+ if(i >= max) {
+ var msecs = (new Date()).getTime() - times[i-max];
+ if(msecs < 1000) {
+ CouchDB.request("GET", "/_sleep?time=" + (msecs+250));
+ }
+ }
+ db = newDb("test_suite_db_" + i, true);
+ times.push((new Date()).getTime());
+
+ // Trigger a delayed commit
+ db.save({_id: "" + i, "lang": "Awesome!"});
}
var open_dbs = getStat("couchdb", "open_databases").current;