You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ei...@apache.org on 2020/04/17 03:13:39 UTC

[couchdb] 05/07: Fail tests on gen_server timeout

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

eiri pushed a commit to branch aegis_key_cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit a76694cc6b56a2bce8f4e40340f7f6fac184c9a5
Author: Eric Avdey <ei...@eiri.ca>
AuthorDate: Thu Apr 16 10:58:41 2020 -0300

    Fail tests on gen_server timeout
---
 src/aegis/test/aegis_key_cache_test.erl | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/aegis/test/aegis_key_cache_test.erl b/src/aegis/test/aegis_key_cache_test.erl
index 2e6680e..e18eb34 100644
--- a/src/aegis/test/aegis_key_cache_test.erl
+++ b/src/aegis/test/aegis_key_cache_test.erl
@@ -19,6 +19,7 @@
 -define(DB, #{aegis => <<0:320>>, uuid => <<0:64>>}).
 -define(VALUE, <<0:8192>>).
 -define(ENCRYPTED, <<1:8, 0:320, 0:4096>>).
+-define(TIMEOUT, 10000).
 
 
 
@@ -29,13 +30,13 @@ basic_test_() ->
         fun teardown/1,
         [
             {"cache unwrapped key on get_wrapped_key",
-            fun test_get_wrapped_key/0},
+            {timeout, ?TIMEOUT, fun test_get_wrapped_key/0}},
             {"cache unwrapped key on encrypt",
-            fun test_encrypt/0},
+            {timeout, ?TIMEOUT, fun test_encrypt/0}},
             {"cache unwrapped key on decrypt",
-            fun test_decrypt/0},
+            {timeout, ?TIMEOUT, fun test_decrypt/0}},
             {"cache unwrapped key per database",
-            fun test_multibase/0}
+            {timeout, ?TIMEOUT, fun test_multibase/0}}
         ]
     }.
 
@@ -47,7 +48,7 @@ setup() ->
     ok = meck:expect(aegis_keywrap, key_wrap, 2, <<0:320>>),
     ok = meck:expect(aegis_keywrap, key_unwrap, fun(_, _) ->
         %% build a line of the waiters
-        timer:sleep(50),
+        timer:sleep(20),
         <<0:256>>
     end),
     ok = meck:expect(aegis, encrypt, 4, ?ENCRYPTED),