Skip to content

Commit

Permalink
failing test case for COUCHDB-844
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@983332 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
kocolosk committed Aug 8, 2010
1 parent b870261 commit 66e560d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions share/www/script/test/delayed_commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
};

0 comments on commit 66e560d

Please sign in to comment.