diff options
author | iilyak <iilyak@users.noreply.github.com> | 2019-08-19 06:07:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-19 06:07:22 -0700 |
commit | 66f820523472cc05839a9d63db272f9300567696 (patch) | |
tree | e56062fa3474e0380f3dd6421a4520835dbbf389 | |
parent | ba3cd0a6fd44c69e0a020a7c7af38db361a2c888 (diff) | |
parent | 68e8c85e463e67131aafea56bbd7581567b5479d (diff) | |
download | couchdb-66f820523472cc05839a9d63db272f9300567696.tar.gz |
Merge pull request #2123 from cloudant/add-timeout-to-fold_docs_with_different_keys
Add timeout for 'fold_docs-with_different_keys' test
-rw-r--r-- | src/fabric/test/fabric2_doc_fold_tests.erl | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/fabric/test/fabric2_doc_fold_tests.erl b/src/fabric/test/fabric2_doc_fold_tests.erl index ee0180f14..3cb68bdac 100644 --- a/src/fabric/test/fabric2_doc_fold_tests.erl +++ b/src/fabric/test/fabric2_doc_fold_tests.erl @@ -20,6 +20,16 @@ -define(DOC_COUNT, 50). +%% eunit implementation of {with, Tests} doesn't detect test name correctly +with(Tests) -> + fun(ArgsTuple) -> + [{Name, ?_test(Fun(ArgsTuple))} || {Name, Fun} <- Tests] + ++ + [{Name, {timeout, Timeout, ?_test(Fun(ArgsTuple))}} || {Name, Timeout, Fun} <- Tests] + end. + +-define(NAMED(A), {atom_to_list(A), fun A/1}). +-define(WITH_TIMEOUT(Timeout, A), {atom_to_list(A), Timeout, fun A/1}). doc_fold_test_() -> { @@ -28,17 +38,17 @@ doc_fold_test_() -> setup, fun setup/0, fun cleanup/1, - {with, [ - fun fold_docs_basic/1, - fun fold_docs_rev/1, - fun fold_docs_with_start_key/1, - fun fold_docs_with_end_key/1, - fun fold_docs_with_both_keys_the_same/1, - fun fold_docs_with_different_keys/1, - fun fold_docs_with_limit/1, - fun fold_docs_with_skip/1, - fun fold_docs_with_skip_and_limit/1 - ]} + with([ + ?NAMED(fold_docs_basic), + ?NAMED(fold_docs_rev), + ?NAMED(fold_docs_with_start_key), + ?NAMED(fold_docs_with_end_key), + ?NAMED(fold_docs_with_both_keys_the_same), + ?WITH_TIMEOUT(10000, fold_docs_with_different_keys), + ?NAMED(fold_docs_with_limit), + ?NAMED(fold_docs_with_skip), + ?NAMED(fold_docs_with_skip_and_limit) + ]) } }. |