You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2019/07/28 20:50:46 UTC

[couchdb] branch jenkins-fix-eunit-timeouts updated (4c2aa36 -> 6147174)

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a change to branch jenkins-fix-eunit-timeouts
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    from 4c2aa36  Increase timeouts on more heavyweight mem3 tests
     new e7650ad  Extend timeouts for _all_ reshard API tests
     new 6147174  Extend timeouts for replication tests

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/mem3/test/mem3_rep_test.erl         |  17 ++---
 src/mem3/test/mem3_reshard_api_test.erl | 108 ++++++++++++++++----------------
 2 files changed, 63 insertions(+), 62 deletions(-)


[couchdb] 02/02: Extend timeouts for replication tests

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch jenkins-fix-eunit-timeouts
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 614717464052d037305f4fdaa9b5c63181a68199
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Sun Jul 28 16:50:25 2019 -0400

    Extend timeouts for replication tests
---
 src/mem3/test/mem3_rep_test.erl | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/mem3/test/mem3_rep_test.erl b/src/mem3/test/mem3_rep_test.erl
index 7e8856f..4a46e7b 100644
--- a/src/mem3/test/mem3_rep_test.erl
+++ b/src/mem3/test/mem3_rep_test.erl
@@ -20,6 +20,7 @@
 
 
 -define(ID, <<"_id">>).
+-define(TIMEOUT, 60). % seconds
 
 setup() ->
     {AllSrc, AllTgt} = {?tempdb(), ?tempdb()},
@@ -65,7 +66,7 @@ mem3_reshard_db_test_() ->
 
 
 replicate_basics(#{allsrc := AllSrc, alltgt := AllTgt}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         DocSpec = #{docs => 10, delete => [5, 9]},
         add_test_docs(AllSrc, DocSpec),
         SDocs = get_all_docs(AllSrc),
@@ -79,11 +80,11 @@ replicate_basics(#{allsrc := AllSrc, alltgt := AllTgt}) ->
         ?assertMatch({ok, 0}, mem3_rep:go(Src, TMap, Opts)),
 
         ?assertEqual(SDocs, get_all_docs(AllTgt))
-    end).
+    end)}.
 
 
 replicate_small_batches(#{allsrc := AllSrc, alltgt := AllTgt}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         DocSpec = #{docs => 10, delete => [5, 9]},
         add_test_docs(AllSrc, DocSpec),
         SDocs = get_all_docs(AllSrc),
@@ -97,11 +98,11 @@ replicate_small_batches(#{allsrc := AllSrc, alltgt := AllTgt}) ->
         ?assertMatch({ok, 0}, mem3_rep:go(Src, TMap, Opts)),
 
         ?assertEqual(SDocs, get_all_docs(AllTgt))
-    end).
+    end)}.
 
 
 replicate_low_batch_count(#{allsrc := AllSrc, alltgt := AllTgt}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         DocSpec = #{docs => 10, delete => [5, 9]},
         add_test_docs(AllSrc, DocSpec),
         SDocs = get_all_docs(AllSrc),
@@ -122,11 +123,11 @@ replicate_low_batch_count(#{allsrc := AllSrc, alltgt := AllTgt}) ->
         ?assertMatch({ok, 0}, mem3_rep:go(Src, TMap, Opts3)),
 
         ?assertEqual(SDocs, get_all_docs(AllTgt))
-    end).
+    end)}.
 
 
 replicate_with_partitions(#{partsrc := PartSrc, parttgt := PartTgt}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         DocSpec = #{
             pdocs => #{
                 <<"PX">> => 15,
@@ -149,7 +150,7 @@ replicate_with_partitions(#{partsrc := PartSrc, parttgt := PartTgt}) ->
         ?assertEqual(PXSrc, get_partition_info(PartTgt, <<"PX">>)),
         ?assertEqual(PYSrc, get_partition_info(PartTgt, <<"PY">>)),
         ?assertEqual(SDocs, get_all_docs(PartTgt))
-    end).
+    end)}.
 
 
 get_partition_info(DbName, Partition) ->


[couchdb] 01/02: Extend timeouts for _all_ reshard API tests

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch jenkins-fix-eunit-timeouts
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit e7650adc70c203560adec3d012ce5a8cdf5127ad
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Sun Jul 28 16:48:28 2019 -0400

    Extend timeouts for _all_ reshard API tests
---
 src/mem3/test/mem3_reshard_api_test.erl | 108 ++++++++++++++++----------------
 1 file changed, 54 insertions(+), 54 deletions(-)

diff --git a/src/mem3/test/mem3_reshard_api_test.erl b/src/mem3/test/mem3_reshard_api_test.erl
index 7faae60..c4df24a 100644
--- a/src/mem3/test/mem3_reshard_api_test.erl
+++ b/src/mem3/test/mem3_reshard_api_test.erl
@@ -111,7 +111,7 @@ mem3_reshard_api_test_() ->
 
 
 basics({Top, _}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         % GET /_reshard
         ?assertMatch({200, #{
             <<"state">> := <<"running">>,
@@ -138,11 +138,11 @@ basics({Top, _}) ->
         ?assertMatch({404, _}, req(get, Top ++ ?RESHARD ++ "/invalidpath")),
         ?assertMatch({405, _}, req(put, Top ++ ?RESHARD, #{dont => thinkso})),
         ?assertMatch({405, _}, req(post, Top ++ ?RESHARD, #{nope => nope}))
-    end).
+    end)}.
 
 
 create_job_basic({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         % POST /_reshard/jobs
         {C1, R1} = req(post, Top ++ ?JOBS, #{type => split, db => Db1}),
         ?assertEqual(201, C1),
@@ -193,11 +193,11 @@ create_job_basic({Top, {Db1, _, _}}) ->
 
         % DELETE /_reshard/jobs/$jobid  should be a 404 as well
         ?assertMatch({404, #{}}, req(delete, Top ++ ?JOBS ++ ?b2l(Id)))
-    end).
+    end)}.
 
 
 create_two_jobs({Top, {Db1, Db2, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         Jobs = Top ++ ?JOBS,
 
         ?assertMatch({201, [#{?OK := true}]},
@@ -219,20 +219,20 @@ create_two_jobs({Top, {Db1, Db2, _}}) ->
         ?assertMatch({200, #{<<"total">> := 1}}, req(get, Top ++ ?RESHARD)),
         {200, #{?OK := true}} = req(delete, Jobs ++ ?b2l(Id2)),
         ?assertMatch({200, #{<<"total">> := 0}}, req(get, Top ++ ?RESHARD))
-    end).
+    end)}.
 
 
 create_multiple_jobs_from_one_post({Top, {_, _, Db3}}) ->
-     ?_test(begin
+     {timeout, ?TIMEOUT, ?_test(begin
         Jobs = Top ++ ?JOBS,
         {C1, R1} = req(post, Jobs, #{type => split, db => Db3}),
         ?assertMatch({201, [#{?OK := true}, #{?OK := true}]}, {C1, R1}),
         ?assertMatch({200, #{<<"total">> := 2}}, req(get, Top ++ ?RESHARD))
-    end).
+    end)}.
 
 
 start_stop_cluster_basic({Top, _}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         Url = Top ++ ?STATE,
 
         ?assertMatch({200, #{
@@ -262,11 +262,11 @@ start_stop_cluster_basic({Top, _}) ->
         }}, req(get, Top ++ ?RESHARD)),
         ?assertMatch({200, _}, req(put, Url, #{state => running})),
         ?assertMatch({200, #{<<"state">> := <<"running">>}}, req(get, Url))
-    end).
+    end)}.
 
 
 test_disabled({Top, _}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         application:set_env(mem3, reshard_disabled, true),
         ?assertMatch({501, _}, req(get, Top ++ ?RESHARD)),
         ?assertMatch({501, _}, req(put, Top ++ ?STATE, #{state => running})),
@@ -274,11 +274,11 @@ test_disabled({Top, _}) ->
         application:unset_env(mem3, reshard_disabled),
         ?assertMatch({200, _}, req(get, Top ++ ?RESHARD)),
         ?assertMatch({200, _}, req(put, Top ++ ?STATE, #{state => running}))
-    end).
+    end)}.
 
 
 start_stop_cluster_with_a_job({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         Url = Top ++ ?STATE,
 
         ?assertMatch({200, _}, req(put, Url, #{state => stopped})),
@@ -317,11 +317,11 @@ start_stop_cluster_with_a_job({Top, {Db1, _, _}}) ->
         ?assertMatch({200, _}, req(put, Url, #{state => running})),
         ?assertMatch({200, #{?ID := Id2, <<"job_state">> := JSt}}
             when JSt =/= <<"stopped">>, req(get, Top ++ ?JOBS ++ ?b2l(Id2)))
-     end).
+     end)}.
 
 
 individual_job_start_stop({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         intercept_state(topoff1),
 
         Body = #{type => split, db => Db1},
@@ -353,11 +353,11 @@ individual_job_start_stop({Top, {Db1, _, _}}) ->
         % Let it continue running and it should complete eventually
         JobPid2 ! continue,
         wait_state(StUrl, <<"completed">>)
-    end).
+    end)}.
 
 
 individual_job_stop_when_cluster_stopped({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         intercept_state(topoff1),
 
         Body = #{type => split, db => Db1},
@@ -398,11 +398,11 @@ individual_job_stop_when_cluster_stopped({Top, {Db1, _, _}}) ->
         % Let it continue running and it should complete eventually
         JobPid2 ! continue,
         wait_state(StUrl, <<"completed">>)
-    end).
+    end)}.
 
 
 create_job_with_invalid_arguments({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         Jobs = Top ++ ?JOBS,
 
         % Nothing in the body
@@ -435,7 +435,7 @@ create_job_with_invalid_arguments({Top, {Db1, _, _}}) ->
         % Can't have both db and shard
         ?assertMatch({400, _}, req(post, Jobs, #{type => split, db => Db1,
              shard => <<"blah">>}))
-    end).
+    end)}.
 
 
 create_job_with_db({Top, {Db1, _, _}}) ->
@@ -495,7 +495,7 @@ create_job_with_shard_name({Top, {_, _, Db3}}) ->
 
 
 completed_job_handling({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         Jobs = Top ++ ?JOBS,
 
         % Run job to completion
@@ -543,105 +543,105 @@ completed_job_handling({Top, {Db1, _, _}}) ->
         ?assertMatch({200, #{<<"state">> := <<"completed">>}}, req(get, StUrl)),
 
         ?assertMatch({200, #{?OK := true}}, req(delete, JobUrl))
-    end).
+    end)}.
 
 
 handle_db_deletion_in_topoff1({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = delete_source_in_state(Top, Db1, topoff1),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"failed">>)
-    end).
+    end)}.
 
 
 handle_db_deletion_in_initial_copy({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = delete_source_in_state(Top, Db1, initial_copy),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"failed">>)
-    end).
+    end)}.
 
 
 handle_db_deletion_in_copy_local_docs({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = delete_source_in_state(Top, Db1, copy_local_docs),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"failed">>)
-    end).
+    end)}.
 
 
 handle_db_deletion_in_build_indices({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = delete_source_in_state(Top, Db1, build_indices),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"failed">>)
-    end).
+    end)}.
 
 
 handle_db_deletion_in_update_shard_map({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = delete_source_in_state(Top, Db1, update_shardmap),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"failed">>)
-    end).
+    end)}.
 
 
 handle_db_deletion_in_wait_source_close({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = delete_source_in_state(Top, Db1, wait_source_close),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"failed">>)
-    end).
+    end)}.
 
 
 recover_in_topoff1({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, topoff1),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 recover_in_initial_copy({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, initial_copy),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 recover_in_copy_local_docs({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, copy_local_docs),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 recover_in_build_indices({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, build_indices),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 recover_in_update_shard_map({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, update_shardmap),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 recover_in_wait_source_close({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, wait_source_close),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 recover_in_topoff3({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, topoff3),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 recover_in_source_delete({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         JobId = recover_in_state(Top, Db1, source_delete),
         wait_state(Top ++ ?JOBS ++ ?b2l(JobId) ++ "/state", <<"completed">>)
-    end).
+    end)}.
 
 
 check_max_jobs({Top, {Db1, Db2, _}}) ->
@@ -683,7 +683,7 @@ check_max_jobs({Top, {Db1, Db2, _}}) ->
 
 
 check_node_and_range_required_params({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         Jobs = Top ++ ?JOBS,
 
         Node = atom_to_binary(node(), utf8),
@@ -705,18 +705,18 @@ check_node_and_range_required_params({Top, {Db1, _, _}}) ->
         {C3, R3} = req(post, Jobs, Body),
         ?assertMatch({201, [#{?OK := true}]}, {C3, R3}),
         wait_to_complete_then_cleanup(Top, R3)
-    end).
+    end)}.
 
 
 cleanup_completed_jobs({Top, {Db1, _, _}}) ->
-    ?_test(begin
+    {timeout, ?TIMEOUT, ?_test(begin
         Body = #{type => split, db => Db1},
         {201, [#{?ID := Id}]} = req(post, Top ++ ?JOBS, Body),
         JobUrl = Top ++ ?JOBS ++ ?b2l(Id),
         wait_state(JobUrl ++ "/state", <<"completed">>),
         delete_db(Top, Db1),
         wait_for_http_code(JobUrl, 404)
-    end).
+    end)}.
 
 
 % Test help functions