aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-11-27 19:57:07 +0100
committerSverker Eriksson <[email protected]>2013-11-27 19:57:07 +0100
commit0ce1af08e397ff1af25f6d3359ad5032f67bf7a8 (patch)
treed3292acf9bd95ee699a5ea5472c319416576ec49 /lib/crypto
parent06188473247fd1edc873d82cf07886fa7e53e8cb (diff)
parentf1ebf482e1460d6146d55aa6cab00ab3e11f1741 (diff)
downloadotp-0ce1af08e397ff1af25f6d3359ad5032f67bf7a8.tar.gz
otp-0ce1af08e397ff1af25f6d3359ad5032f67bf7a8.tar.bz2
otp-0ce1af08e397ff1af25f6d3359ad5032f67bf7a8.zip
Merge branch 'sverk/crypto-no_answer_from_tc_supervisor' into maint
* sverk/crypto-no_answer_from_tc_supervisor: crypto: Avoid test_server crash 'no_answer_from_tc_supervisor'
Diffstat (limited to 'lib/crypto')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 58aaa78d28..645b1203ef 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -143,7 +143,8 @@ app(Config) when is_list(Config) ->
hash() ->
[{doc, "Test all different hash functions"}].
hash(Config) when is_list(Config) ->
- {Type, Msgs, Digests} = proplists:get_value(hash, Config),
+ {Type, MsgsLE, Digests} = proplists:get_value(hash, Config),
+ Msgs = lists:map(fun lazy_eval/1, MsgsLE),
[LongMsg | _] = lists:reverse(Msgs),
Inc = iolistify(LongMsg),
[IncrDigest | _] = lists:reverse(Digests),
@@ -154,7 +155,8 @@ hash(Config) when is_list(Config) ->
hmac() ->
[{doc, "Test all different hmac functions"}].
hmac(Config) when is_list(Config) ->
- {Type, Keys, Data, Expected} = proplists:get_value(hmac, Config),
+ {Type, Keys, DataLE, Expected} = proplists:get_value(hmac, Config),
+ Data = lists:map(fun lazy_eval/1, DataLE),
hmac(Type, Keys, Data, Expected),
hmac(Type, lists:map(fun iolistify/1, Keys), lists:map(fun iolistify/1, Data), Expected),
hmac_increment(Type).
@@ -795,7 +797,13 @@ rfc_4634_sha512_digests() ->
hexstr2bin("8E959B75DAE313DA8CF4F72814FC143F8F7779C6EB9F7FA17299AEADB6889018501D289E4900F7E4331B99DEC4B5433AC7D329EEB6DD26545E96E55B874BE909")].
long_msg() ->
- lists:duplicate(1000000, $a).
+ fun() -> lists:duplicate(1000000, $a) end.
+
+%% Building huge terms (like long_msg/0) in init_per_group seems to cause
+%% test_server crash with 'no_answer_from_tc_supervisor' sometimes on some
+%% machines. Therefore lazy evaluation when test case has started.
+lazy_eval(F) when is_function(F) -> F();
+lazy_eval(Term) -> Term.
long_sha_digest() ->
hexstr2bin("34aa973c" "d4c4daa4" "f61eeb2b" "dbad2731" "6534016f").