Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added test for replication issue

  • Loading branch information...
commit 8e3b2b99e343ce39b60e69b5af25ac5836c6ca84 1 parent 8482e46
@caolan caolan authored daleharvey committed
Showing with 27 additions and 1 deletion.
  1. +27 −1 tests/test.replication.js
View
28 tests/test.replication.js
@@ -89,6 +89,32 @@ asyncTest("Test checkpoint", function() {
});
});
+asyncTest("Test checkpoint 2", function() {
+ var self = this;
+ var doc = {_id: "3", count: 0};
+ initDBPair(this.name, this.remote, function(db, remote) {
+ remote.put(doc, {}, function(err, results) {
+ db.replicate.from(self.remote, function(err, result) {
+ ok(result.ok, 'replication was ok');
+ ok(result.docs_written === docs.length, 'correct # docs written');
+ doc._rev = results.rev;
+ doc.count++;
+ remote.put(doc, {}, function(err, results) {
+ doc._rev = results.rev;
+ doc.count++;
+ remote.put(doc, {}, function(err, results) {
+ db.replicate.from(self.remote, function(err, result) {
+ ok(result.ok, 'replication was ok');
+ ok(result.docs_written === 1, 'correct # docs written');
+ start();
+ });
+ });
+ });
+ });
+ });
+ });
+});
+
// CouchDB will not generate a conflict here, it uses a deteministic
// method to generate the revision number, however we cannot copy its
// method as it depends on erlangs internal data representation
@@ -107,4 +133,4 @@ asyncTest("Test basic conflict", function() {
});
});
});
-});
+});
Please sign in to comment.
Something went wrong with that request. Please try again.