You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2021/09/09 02:44:05 UTC

[couchdb] branch improve-views-tests created (now 9815c82)

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

jaydoane pushed a change to branch improve-views-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 9815c82  Separate bad_config_test into separate tests

This branch includes the following new commits:

     new 6432325  Increase timeout for couch views active tasks tests
     new 9815c82  Separate bad_config_test into separate 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.


[couchdb] 02/02: Separate bad_config_test into separate tests

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

jaydoane pushed a commit to branch improve-views-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9815c82644b905b0ad5507f309a18601f872c6c9
Author: Jay Doane <ja...@apache.org>
AuthorDate: Wed Sep 8 19:43:44 2021 -0700

    Separate bad_config_test into separate tests
    
    Instead of running as a single test, separate each corresponding field
    and error into its own test, with its own timeout. A typical run now
    looks like:
    
    make eunit apps=couch_views suites=couch_views_batch_impl tests=bad_config_test_
    
    ======================== EUnit ========================
    couch_views_batch_impl:186: bad_config_test_ (batch_initial_size)...[0.104 s] ok
    couch_views_batch_impl:186: bad_config_test_ (batch_search_increment)...[0.077 s] ok
    couch_views_batch_impl:186: bad_config_test_ (batch_sense_increment)...[0.074 s] ok
    couch_views_batch_impl:186: bad_config_test_ (batch_max_tx_size_bytes)...[0.077 s] ok
    couch_views_batch_impl:186: bad_config_test_ (batch_max_tx_time_msec)...[0.076 s] ok
    couch_views_batch_impl:186: bad_config_test_ (batch_threshold_penalty)...[0.074 s] ok
    =======================================================
      All 6 tests passed.
    
    Previously, these tests were timing out when CI became resource
    constrained. Examples of multiple runs show how prone to timing out
    after 5 seconds the old monolithic bad_config_test was:
    
      couch_views_batch_impl: good_config_test...[0.217 s] ok
      couch_views_batch_impl: bad_config_test...[1.347 s] ok
    
      couch_views_batch_impl: good_config_test...[0.393 s] ok
      couch_views_batch_impl: bad_config_test...[2.332 s] ok
    
      couch_views_batch_impl: good_config_test...[0.358 s] ok
      couch_views_batch_impl: bad_config_test...[2.211 s] ok
    
      couch_views_batch_impl: good_config_test...[0.942 s] ok
      couch_views_batch_impl: bad_config_test...*timed out*
    
      couch_views_batch_impl: good_config_test...[1.179 s] ok
      couch_views_batch_impl: bad_config_test...*timed out*
    
      couch_views_batch_impl: good_config_test...[0.497 s] ok
      couch_views_batch_impl: bad_config_test...*timed out*
---
 src/couch_views/src/couch_views_batch_impl.erl | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/couch_views/src/couch_views_batch_impl.erl b/src/couch_views/src/couch_views_batch_impl.erl
index 1bc6014..8588528 100644
--- a/src/couch_views/src/couch_views_batch_impl.erl
+++ b/src/couch_views/src/couch_views_batch_impl.erl
@@ -150,8 +150,8 @@ good_config_test() ->
         )
     end).
 
-bad_config_test() ->
-    Fields = [
+bad_config_test_() ->
+    FieldErrors = [
         {batch_initial_size, invalid_non_neg_integer},
         {batch_search_increment, invalid_non_neg_integer},
         {batch_sense_increment, invalid_non_neg_integer},
@@ -159,16 +159,17 @@ bad_config_test() ->
         {batch_max_tx_time_msec, invalid_non_neg_integer},
         {batch_threshold_penalty, invalid_float}
     ],
-    lists:foreach(
+    lists:map(
         fun({Field, Error}) ->
-            with_bad_config(atom_to_list(Field), fun() ->
-                ?assertError(
-                    {Error, {couch_views, Field, _}},
+            FieldName = atom_to_list(Field),
+            {FieldName, ?_assertError(
+                {Error, {couch_views, Field, _}},
+                with_bad_config(FieldName, fun() ->
                     start(#mrst{}, undefined)
-                )
-            end)
+                end))
+            }
         end,
-        Fields
+        FieldErrors
     ).
 
 float_range_test() ->

[couchdb] 01/02: Increase timeout for couch views active tasks tests

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

jaydoane pushed a commit to branch improve-views-tests
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 64323256a34f77f88180b050b0f21a6f2bf86d75
Author: Jay Doane <ja...@apache.org>
AuthorDate: Wed Sep 8 11:06:02 2021 -0700

    Increase timeout for couch views active tasks tests
    
    This doubles the default timeout to 10 seconds for these two tests.
    
    They typically take a long time to run:
    
        couch_views_active_tasks_test:69: active_tasks_test_ (verify_basic_active_tasks)...[2.444 s] ok
        couch_views_active_tasks_test:70: active_tasks_test_ (verify_muliple_active_tasks)...[2.678 s] ok
    
        couch_views_active_tasks_test:69: active_tasks_test_ (verify_basic_active_tasks)...[2.646 s] ok
        couch_views_active_tasks_test:70: active_tasks_test_ (verify_muliple_active_tasks)...[2.743 s] ok
    
        couch_views_active_tasks_test:69: active_tasks_test_ (verify_basic_active_tasks)...[2.910 s] ok
        couch_views_active_tasks_test:70: active_tasks_test_ (verify_muliple_active_tasks)...[3.063 s] ok
    
    and when resources are constrained, often time out:
    
        couch_views_active_tasks_test:69: active_tasks_test_ (verify_basic_active_tasks)...[2.044 s] ok
        couch_views_active_tasks_test:70: active_tasks_test_ (verify_muliple_active_tasks)...*timed out*
    
        couch_views_active_tasks_test:69: active_tasks_test_ (verify_basic_active_tasks)...[1.777 s] ok
        couch_views_active_tasks_test:70: active_tasks_test_ (verify_muliple_active_tasks)...*timed out*
    
        couch_views_active_tasks_test:69: active_tasks_test_ (verify_basic_active_tasks)...*timed out*
        couch_views_active_tasks_test:70: active_tasks_test_ (verify_muliple_active_tasks)...*timed out*
---
 src/couch_views/test/couch_views_active_tasks_test.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/couch_views/test/couch_views_active_tasks_test.erl b/src/couch_views/test/couch_views_active_tasks_test.erl
index eded1fa..5e7e7be 100644
--- a/src/couch_views/test/couch_views_active_tasks_test.erl
+++ b/src/couch_views/test/couch_views_active_tasks_test.erl
@@ -66,8 +66,8 @@ active_tasks_test_() ->
                 fun foreach_setup/0,
                 fun foreach_teardown/1,
                 [
-                    ?TDEF_FE(verify_basic_active_tasks),
-                    ?TDEF_FE(verify_muliple_active_tasks)
+                    ?TDEF_FE(verify_basic_active_tasks, 10),
+                    ?TDEF_FE(verify_muliple_active_tasks, 10)
                 ]
             }
         }