couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bitdid...@apache.org
Subject git commit: Failing test for duplicates in bulk docs
Date Fri, 18 Nov 2011 20:31:52 GMT
Updated Branches:
  refs/heads/master 1cb7d885f -> 0216674fd


Failing test for duplicates in bulk docs

If a duplicate or worse yet, two different docs with the same id is
contained in a bullk docs save, both are returned as in conflict but
one is actually saved, usually the second one.

jira-911


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/0216674f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/0216674f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/0216674f

Branch: refs/heads/master
Commit: 0216674fd02928ed679e030d20dae5f003839cd7
Parents: 1cb7d88
Author: Bob Dionne <bitdiddle@apache.org>
Authored: Tue Oct 11 14:20:21 2011 -0400
Committer: Bob Dionne <bitdiddle@apache.org>
Committed: Fri Nov 18 15:31:01 2011 -0500

----------------------------------------------------------------------
 share/www/script/test/bulk_docs.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0216674f/share/www/script/test/bulk_docs.js
----------------------------------------------------------------------
diff --git a/share/www/script/test/bulk_docs.js b/share/www/script/test/bulk_docs.js
index 802eca7..27a97c8 100644
--- a/share/www/script/test/bulk_docs.js
+++ b/share/www/script/test/bulk_docs.js
@@ -108,4 +108,17 @@ couchTests.bulk_docs = function(debug) {
   result = JSON.parse(req.responseText);
   T(result.error == "bad_request");
   T(result.reason == "Missing JSON list of 'docs'");
+
+  // jira-911
+  db.deleteDb();
+  db.createDb();
+  docs = [];
+  docs.push({"_id":"0", "a" : 0});
+  docs.push({"_id":"1", "a" : 1});
+  docs.push({"_id":"1", "a" : 2});
+  docs.push({"_id":"3", "a" : 3});
+  results = db.bulkSave(docs);
+  T(results[1].id == "1");
+  T(results[1].error == undefined);
+  T(results[2].error == "conflict");
 };


Mime
View raw message