diff options
author | Damien F. Katz <damien@apache.org> | 2009-04-27 19:08:33 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-04-27 19:08:33 +0000 |
commit | f5d752a3c5f1c05962a7b693b54636967bfa7a5d (patch) | |
tree | 6af66ef375bf44ba6f2b83b53fea4e366a81cfdc /share/www/script/test | |
parent | 37541bbf91d09ad0200f2c26c7a3f79fdf050801 (diff) |
Fix and test for COUCHDB-334 where a database with delayed commits pending is considered idle, and subject to losing changes when shutdown
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@769109 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test')
-rw-r--r-- | share/www/script/test/delayed_commits.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/share/www/script/test/delayed_commits.js b/share/www/script/test/delayed_commits.js index daebdb8d..0ead2d84 100644 --- a/share/www/script/test/delayed_commits.js +++ b/share/www/script/test/delayed_commits.js @@ -90,4 +90,26 @@ couchTests.delayed_commits = function(debug) { T(db.open("4") != null); + // Now test that when we exceed the max_dbs_open, pending commits are safely + // written. + T(db.save({_id:"5",foo:"bar"}).ok); + var max = 2; + run_on_modified_server( + [{section: "couchdb", + key: "max_dbs_open", + value: max.toString()}], + + function () { + for(var i=0; i<max; i++) { + var dbi = new CouchDB("test_suite_db" + i); + dbi.deleteDb(); + dbi.createDb(); + } + T(db.open("5").foo=="bar"); + for(var i=0; i<max+1; i++) { + var dbi = new CouchDB("test_suite_db" + i); + dbi.deleteDb(); + } + }); + }; |