This is an automated email from the ASF dual-hosted git repository. jan pushed a commit to branch rebase/access-2023 in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f4b8742b07a98dfab7b407e260d65ebacd31dcde Author: Jan Lehnardt <[email protected]> AuthorDate: Mon May 22 09:08:02 2023 +0200 wip --- src/couch/src/couch_doc.erl | 2 +- .../test/eunit/couchdb_update_conflicts_tests.erl | 56 ++++++++++++---------- test/elixir/test/view_include_docs_test.exs | 2 +- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/src/couch/src/couch_doc.erl b/src/couch/src/couch_doc.erl index 75bfb7d1b..6e6cca9e4 100644 --- a/src/couch/src/couch_doc.erl +++ b/src/couch/src/couch_doc.erl @@ -347,7 +347,7 @@ transfer_fields([{<<"_conflicts">>, _} | Rest], Doc, DbName) -> transfer_fields(Rest, Doc, DbName); transfer_fields([{<<"_deleted_conflicts">>, _} | Rest], Doc, DbName) -> transfer_fields(Rest, Doc, DbName); -transfer_fields([{<<"_access">>, Access} = Field | Rest], Doc, DbName) -> +transfer_fields([{<<"_access">>, Access} | Rest], Doc, DbName) -> transfer_fields(Rest, Doc#doc{access = Access}, DbName); % special fields for replication documents transfer_fields( diff --git a/src/couch/test/eunit/couchdb_update_conflicts_tests.erl b/src/couch/test/eunit/couchdb_update_conflicts_tests.erl index d75b335b1..96e45a97a 100644 --- a/src/couch/test/eunit/couchdb_update_conflicts_tests.erl +++ b/src/couch/test/eunit/couchdb_update_conflicts_tests.erl @@ -19,7 +19,7 @@ -define(DOC_ID, <<"foobar">>). -define(LOCAL_DOC_ID, <<"_local/foobar">>). % TODO: enable 1000, 2000, 5000, 10000]). --define(NUM_CLIENTS, [100, 500]). +-define(NUM_CLIENTS, [100]). -define(TIMEOUT, 200000). start() -> @@ -55,8 +55,8 @@ view_indexes_cleanup_test_() -> fun start/0, fun test_util:stop_couch/1, [ - concurrent_updates(), - bulk_docs_updates() + concurrent_updates()%, + % bulk_docs_updates() ] } }. @@ -75,20 +75,20 @@ concurrent_updates() -> } }. -bulk_docs_updates() -> - { - "Bulk docs updates", - { - foreach, - fun setup/0, - fun teardown/1, - [ - fun should_bulk_create_delete_doc/1, - fun should_bulk_create_local_doc/1, - fun should_ignore_invalid_local_doc/1 - ] - } - }. +% bulk_docs_updates() -> +% { +% "Bulk docs updates", +% { +% foreach, +% fun setup/0, +% fun teardown/1, +% [ +% fun should_bulk_create_delete_doc/1, +% fun should_bulk_create_local_doc/1, +% fun should_ignore_invalid_local_doc/1 +% ] +% } +% }. should_concurrently_update_doc(NumClients, {DbName, InitRev}) -> { @@ -101,16 +101,22 @@ should_concurrently_update_doc(NumClients, {DbName, InitRev}) -> ]} }. -should_bulk_create_delete_doc({DbName, InitRev}) -> - ?_test(bulk_delete_create(DbName, InitRev)). - -should_bulk_create_local_doc({DbName, _}) -> - ?_test(bulk_create_local_doc(DbName)). - -should_ignore_invalid_local_doc({DbName, _}) -> - ?_test(ignore_invalid_local_doc(DbName)). +% should_bulk_create_delete_doc({DbName, InitRev}) -> +% ?_test(bulk_delete_create(DbName, InitRev)). +% +% should_bulk_create_local_doc({DbName, _}) -> +% ?_test(bulk_create_local_doc(DbName)). +% +% should_ignore_invalid_local_doc({DbName, _}) -> +% ?_test(ignore_invalid_local_doc(DbName)). concurrent_doc_update(NumClients, DbName, InitRev) -> + eprof:start(), + eprof:log("/tmp/eprof1.log"), + eprof:profile(fun() -> concurrent_doc_update1(NumClients, DbName, InitRev) end), + eprof:analyze(). + +concurrent_doc_update1(NumClients, DbName, InitRev) -> Clients = lists:map( fun(Value) -> ClientDoc = couch_doc:from_json_obj( diff --git a/test/elixir/test/view_include_docs_test.exs b/test/elixir/test/view_include_docs_test.exs index a77753058..89e35aa37 100644 --- a/test/elixir/test/view_include_docs_test.exs +++ b/test/elixir/test/view_include_docs_test.exs @@ -238,7 +238,7 @@ defmodule ViewIncludeDocsTest do doc2 = %{_id: "bar", value: 2, str: "2"} {:ok, _} = create_doc(db_name_a, doc2) - replicate(db_name_a, db_name_b) + replicate("http://127.0.0.1:15984/#{db_name_a}", "http://127.0.0.1:15984/#{db_name_b}") resp = Couch.get("/#{db_name_b}/foo", query: [conflicts: true]) assert resp.status_code == 200
