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/10/27 04:37:07 UTC

[couchdb] 01/03: Mock couch_log for config application

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

jaydoane pushed a commit to branch mem3-test-fixes
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 173537d5bfdb419bf70baacf25f1f59027ac3369
Author: Jay Doane <ja...@apache.org>
AuthorDate: Tue Oct 26 16:44:07 2021 -0700

    Mock couch_log for config application
    
    Prevent failures like this:
    
        mem3_sync_event_listener:267: should_set_sync_delay...*failed*
    in function gen_server:call/3 (gen_server.erl, line 214)
    in call from mem3_sync_event_listener:'-should_set_sync_delay/1-fun-1-'/1
    (src/mem3_sync_event_listener.erl, line 268)
    **exit:{{noproc,{gen_server,call,
                         [couch_log_server,
                          {log,{log_entry,notice,<0.31789.5>,
                                          ["config",58,32,91,[...]|...],
                                          "--------",
                                          ["2021",45,[...]|...]}}]}},
---
 src/mem3/src/mem3_sync_event_listener.erl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mem3/src/mem3_sync_event_listener.erl b/src/mem3/src/mem3_sync_event_listener.erl
index cad3422..5a8d162 100644
--- a/src/mem3/src/mem3_sync_event_listener.erl
+++ b/src/mem3/src/mem3_sync_event_listener.erl
@@ -218,6 +218,10 @@ subscribe_for_config() ->
 -include_lib("couch/include/couch_eunit.hrl").
 
 setup_all() ->
+    % couch_log used by config app
+    ok = meck:expect(couch_log, notice, 2, ok),
+    ok = meck:expect(couch_log, warning, 2, ok),
+
     application:start(config),
 
     ok = meck:new(couch_event, [passthrough]),