couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r983332 - /couchdb/branches/1.0.x/share/www/script/test/delayed_commits.js
Date Sun, 08 Aug 2010 00:45:58 GMT
Author: kocolosk
Date: Sun Aug  8 00:45:58 2010
New Revision: 983332

URL: http://svn.apache.org/viewvc?rev=983332&view=rev
Log:
failing test case for COUCHDB-844

Modified:
    couchdb/branches/1.0.x/share/www/script/test/delayed_commits.js

Modified: couchdb/branches/1.0.x/share/www/script/test/delayed_commits.js
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/share/www/script/test/delayed_commits.js?rev=983332&r1=983331&r2=983332&view=diff
==============================================================================
--- couchdb/branches/1.0.x/share/www/script/test/delayed_commits.js (original)
+++ couchdb/branches/1.0.x/share/www/script/test/delayed_commits.js Sun Aug  8 00:45:58 2010
@@ -122,4 +122,33 @@ couchTests.delayed_commits = function(de
       }
     });
 
+
+  // 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);
+    });
 };



Mime
View raw message