From 1b395e9c4b3ac9becb504dd1cdc73c58c1c85b5a Mon Sep 17 00:00:00 2001 From: Ingela Anderton Andin Date: Thu, 25 Jul 2019 14:55:17 +0200 Subject: 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 --- lib/ssl/test/ssl_bench_SUITE.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/ssl') 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, -- cgit v1.2.3