You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2023/12/07 16:24:17 UTC

(couchdb) branch fix-increase-timeout updated (b6938c5b7 -> c1f612255)

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

jiahuili430 pushed a change to branch fix-increase-timeout
in repository https://gitbox.apache.org/repos/asf/couchdb.git


 discard b6938c5b7 Fix flaky tests by increasing timeout
     new c1f612255 Fix flaky tests by increasing timeout

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b6938c5b7)
            \
             N -- N -- N   refs/heads/fix-increase-timeout (c1f612255)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 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/couch/test/eunit/couch_js_tests.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


(couchdb) 01/01: Fix flaky tests by increasing timeout

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

jiahuili430 pushed a commit to branch fix-increase-timeout
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit c1f61225568eff0d94c2e8013bbce35dcb76221e
Author: Jiahui Li <li...@gmail.com>
AuthorDate: Thu Dec 7 10:08:17 2023 -0600

    Fix flaky tests by increasing timeout
---
 src/couch/test/eunit/couch_js_tests.erl | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/couch/test/eunit/couch_js_tests.erl b/src/couch/test/eunit/couch_js_tests.erl
index 059a07e20..10eb4f859 100644
--- a/src/couch/test/eunit/couch_js_tests.erl
+++ b/src/couch/test/eunit/couch_js_tests.erl
@@ -13,13 +13,22 @@
 -module(couch_js_tests).
 -include_lib("couch/include/couch_eunit.hrl").
 
+setup() ->
+    Ctx = test_util:start_couch(),
+    ok = meck:new(config, [passthrough]),
+    Ctx.
+
+teardown(Ctx) ->
+    meck:unload(),
+    test_util:stop_couch(Ctx).
+
 couch_js_test_() ->
     {
         "Test couchjs",
         {
             setup,
-            fun test_util:start_couch/0,
-            fun test_util:stop_couch/1,
+            fun setup/0,
+            fun teardown/1,
             with([
                 ?TDEF(should_create_sandbox),
                 ?TDEF(should_reset_properly),
@@ -29,8 +38,8 @@ couch_js_test_() ->
                 ?TDEF(should_replace_broken_utf16),
                 ?TDEF(should_allow_js_string_mutations),
                 ?TDEF(should_bump_timing_and_call_stats),
-                ?TDEF(should_exit_on_oom, 60000),
-                ?TDEF(should_exit_on_internal_error, 60000)
+                ?TDEF(should_exit_on_oom, 60),
+                ?TDEF(should_exit_on_internal_error, 60)
             ])
         }
     }.
@@ -344,6 +353,7 @@ should_bump_timing_and_call_stats(_) ->
 
 %% erlfmt-ignore
 should_exit_on_oom(_) ->
+    ok = meck:expect(config, get_integer, fun("couchdb", "os_process_timeout", _) -> 15000 end),
     Src = <<"
         var state = [];
         function(doc) {
@@ -363,6 +373,7 @@ should_exit_on_internal_error(_) ->
     % A different way to trigger OOM which previously used to
     % throw an InternalError on SM. Check that we still exit on that
     % type of error
+    ok = meck:expect(config, get_integer, fun("couchdb", "os_process_timeout", _) -> 15000 end),
     Src = <<"
         function(doc) {
             function mkstr(l) {
@@ -387,7 +398,7 @@ should_exit_on_internal_error(_) ->
         throw:{<<"InternalError">>, _} ->
             ok;
         % gen_server may die before replying
-        exit:{noproc, {gen_server,call, _}} ->
+        exit:{noproc, {gen_server, call, _}} ->
             ok;
         % or it may die with an epipe if it crashes while we send/recv data to it
         exit:{epipe, {gen_server, call, _}} ->