aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2019-07-25 14:55:17 +0200
committerIngela Anderton Andin <[email protected]>2019-07-26 14:44:57 +0200
commit1b395e9c4b3ac9becb504dd1cdc73c58c1c85b5a (patch)
tree941853e20b0746ac332a3c197a89ac14b1c9fac7
parent22b71cc0264a1db0dd813893b883d34b7e5ee88e (diff)
downloadotp-1b395e9c4b3ac9becb504dd1cdc73c58c1c85b5a.tar.gz
otp-1b395e9c4b3ac9becb504dd1cdc73c58c1c85b5a.tar.bz2
otp-1b395e9c4b3ac9becb504dd1cdc73c58c1c85b5a.zip
ssl: Avoid devision with zero in ssl_bench_SUITE
When one test in ssl_bench_SUITE is run as a smoke test in the ordinary test runs it might get problems on windows as time measurement is to coarse
-rw-r--r--lib/ssl/test/ssl_bench_SUITE.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ssl/test/ssl_bench_SUITE.erl b/lib/ssl/test/ssl_bench_SUITE.erl
index 35efa2b8a3..a297539c36 100644
--- a/lib/ssl/test/ssl_bench_SUITE.erl
+++ b/lib/ssl/test/ssl_bench_SUITE.erl
@@ -174,7 +174,12 @@ do_test(Type, TC, Loop, ParallellConnections, Server) ->
end,
{TimeInMicro, _} = timer:tc(Run),
TotalTests = ParallellConnections * Loop,
- TestPerSecond = 1000000 * TotalTests div TimeInMicro,
+ TestPerSecond = case TimeInMicro of
+ 0 ->
+ undefined;
+ _ ->
+ 1000000 * TotalTests div TimeInMicro
+ end,
io:format("TC ~p ~p ~p ~p 1/s~n", [TC, Type, ParallellConnections, TestPerSecond]),
unlink(SPid),
SPid ! quit,