Skip to content

Commit

Permalink
CIs and bad performance, name a more iconice duo
Browse files Browse the repository at this point in the history
retry to still reach it.
  • Loading branch information
PragTob committed Mar 27, 2019
1 parent 3c6c7eb commit f718c74
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions test/benchee/benchmark/runner_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,20 @@ defmodule Benchee.Benchmark.RunnerTest do
end

test "very fast function times are almost 0 with function call overhead elimination" do
suite =
%{configuration: %{measure_function_call_overhead: true, time: 200_000_000}}
|> test_suite()
|> Benchmark.benchmark("", fn -> nil end)
|> Benchmark.collect(TestPrinter)
|> Benchee.statistics()
retrying(fn ->
suite =
%{configuration: %{measure_function_call_overhead: true, time: 200_000_000}}
|> test_suite()
|> Benchmark.benchmark("", fn -> nil end)
|> Benchmark.collect(TestPrinter)
|> Benchee.statistics()

[%{run_time_data: %{statistics: %{median: median}}}] = suite.scenarios
[%{run_time_data: %{statistics: %{median: median}}}] = suite.scenarios

# Should be 0 if it works correctly, give a bit of leeway - especially the appveyor CI
# with Windows has a tougher time here as it repeats the function call
assert median <= 60
# Should be 0 if it works correctly, give a bit of leeway - especially the appveyor CI
# with Windows has a tougher time here as it repeats the function call
assert median <= 60
end)
end

@tag :performance
Expand Down

0 comments on commit f718c74

Please sign in to comment.