You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/11/26 14:42:44 UTC

git commit: Improve test 074-doc-update-conflicts.t

Updated Branches:
  refs/heads/master 82441c123 -> 3bc6cc5ce


Improve test 074-doc-update-conflicts.t

Verify that only one leaf revision of the document was really
persisted (don't relly only on number of conflicts errors and
the winning revision's content).


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

Branch: refs/heads/master
Commit: 3bc6cc5ceb92ebf88c00ac8995cc5294b0cd1097
Parents: 82441c1
Author: Filipe David Borba Manana <fd...@apache.org>
Authored: Sat Nov 26 13:41:07 2011 +0000
Committer: Filipe David Borba Manana <fd...@apache.org>
Committed: Sat Nov 26 13:41:07 2011 +0000

----------------------------------------------------------------------
 test/etap/074-doc-update-conflicts.t |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3bc6cc5c/test/etap/074-doc-update-conflicts.t
----------------------------------------------------------------------
diff --git a/test/etap/074-doc-update-conflicts.t b/test/etap/074-doc-update-conflicts.t
index d1be3ae..7c2f80d 100755
--- a/test/etap/074-doc-update-conflicts.t
+++ b/test/etap/074-doc-update-conflicts.t
@@ -26,7 +26,7 @@ test_db_name() -> <<"couch_test_update_conflicts">>.
 main(_) ->
     test_util:init_code_path(),
 
-    etap:plan(15),
+    etap:plan(25),
     case (catch test()) of
         ok ->
             etap:end_tests();
@@ -106,8 +106,10 @@ test_concurrent_doc_update(NumClients) ->
         "Got " ++ ?i2l(NumClients - 1) ++ " client conflicts"),
 
     {ok, Db2} = couch_db:open_int(test_db_name(), []),
-    {ok, Doc2} = couch_db:open_doc(Db2, <<"foobar">>, []),
+    {ok, Leaves} = couch_db:open_doc_revs(Db2, <<"foobar">>, all, []),
     ok = couch_db:close(Db2),
+    etap:is(length(Leaves), 1, "Only one document revision was persisted"),
+    [{ok, Doc2}] = Leaves,
     {JsonDoc} = couch_doc:to_json_obj(Doc2, []),
     etap:is(
         couch_util:get_value(<<"value">>, JsonDoc),
@@ -121,8 +123,10 @@ test_concurrent_doc_update(NumClients) ->
     couch_server_sup:start_link(test_util:config_files()),
 
     {ok, Db3} = couch_db:open_int(test_db_name(), []),
-    {ok, Doc3} = couch_db:open_doc(Db3, <<"foobar">>, []),
+    {ok, Leaves2} = couch_db:open_doc_revs(Db3, <<"foobar">>, all, []),
     ok = couch_db:close(Db3),
+    etap:is(length(Leaves2), 1, "Only one document revision was persisted"),
+    [{ok, Doc3}] = Leaves,
     etap:is(Doc3, Doc2, "Got same document after server restart"),
 
     delete_db(Db3).