From ba51999fa65d9a5a87b4d9848a6e2573a8812e8d Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Fri, 12 Feb 2021 11:25:53 -0800 Subject: Fix bug with iperf and don't profile runc. Fix issue with iperf where b.N wasn't changing across runs. Also, if the given runtime is runc/not given, don't run a profile against it. PiperOrigin-RevId: 357231450 --- test/benchmarks/network/iperf_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/benchmarks/network') diff --git a/test/benchmarks/network/iperf_test.go b/test/benchmarks/network/iperf_test.go index 5e81149fe..d8dd2a6ae 100644 --- a/test/benchmarks/network/iperf_test.go +++ b/test/benchmarks/network/iperf_test.go @@ -25,10 +25,6 @@ import ( ) func BenchmarkIperf(b *testing.B) { - iperf := tools.Iperf{ - Num: b.N, - } - clientMachine, err := harness.GetMachine() if err != nil { b.Fatalf("failed to get machine: %v", err) @@ -93,6 +89,10 @@ func BenchmarkIperf(b *testing.B) { b.Fatalf("failed to wait for server: %v", err) } + iperf := tools.Iperf{ + Num: b.N, + } + // Run the client. b.ResetTimer() out, err := client.Run(ctx, dockerutil.RunOpts{ @@ -103,6 +103,7 @@ func BenchmarkIperf(b *testing.B) { } b.StopTimer() iperf.Report(b, out) + b.StartTimer() }) } } -- cgit v1.2.3