diff options
author | Noah Slater <nslater@apache.org> | 2010-08-09 18:08:52 +0000 |
---|---|---|
committer | Noah Slater <nslater@apache.org> | 2010-08-09 18:08:52 +0000 |
commit | 44f0bcbdb650fcfb5c8c2e0c24c00603f42824f4 (patch) | |
tree | 4e1d28a90e48b4cea891164f6100d3eae9c90099 /share/www/script/test/delayed_commits.js | |
parent | 38b059fefa9a659a35ac8ad5db47134dcd8506b6 (diff) | |
parent | bfa939c1ee995cb4c69766af1b57031c564ebd2a (diff) |
tagging 1.0.1
git-svn-id: https://svn.apache.org/repos/asf/couchdb/tags/1.0.1@983758 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/delayed_commits.js')
-rw-r--r-- | share/www/script/test/delayed_commits.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/share/www/script/test/delayed_commits.js b/share/www/script/test/delayed_commits.js index d0c87182..dbb072fb 100644 --- a/share/www/script/test/delayed_commits.js +++ b/share/www/script/test/delayed_commits.js @@ -122,4 +122,33 @@ couchTests.delayed_commits = function(debug) { } }); + + // Test that a conflict can't cause delayed commits to fail + run_on_modified_server( + [{section: "couchdb", + key: "delayed_commits", + value: "true"}], + + function() { + //First save a document and commit it + T(db.save({_id:"6",a:2,b:4}).ok); + T(db.ensureFullCommit().ok); + //Generate a conflict + try { + db.save({_id:"6",a:2,b:4}); + } catch( e) { + T(e.error == "conflict"); + } + //Wait for the delayed commit interval to pass + var time = new Date(); + while(new Date() - time < 2000); + //Save a new doc + T(db.save({_id:"7",a:2,b:4}).ok); + //Wait for the delayed commit interval to pass + var time = new Date(); + while(new Date() - time < 2000); + //Crash the server and make sure the last doc was written + restartServer(); + T(db.open("7") != null); + }); }; |