summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2021-02-12 11:25:53 -0800
committergVisor bot <gvisor-bot@google.com>2021-02-12 11:28:16 -0800
commitba51999fa65d9a5a87b4d9848a6e2573a8812e8d (patch)
treec3c70818ad5958e874c175134755c4dccb2b5097
parenta6d813ad55ae80a2c4173fc3fd3961236327cf8b (diff)
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
-rw-r--r--pkg/test/dockerutil/container.go2
-rw-r--r--test/benchmarks/network/iperf_test.go9
2 files changed, 6 insertions, 5 deletions
diff --git a/pkg/test/dockerutil/container.go b/pkg/test/dockerutil/container.go
index 7bacb70d3..41fcf4978 100644
--- a/pkg/test/dockerutil/container.go
+++ b/pkg/test/dockerutil/container.go
@@ -216,7 +216,7 @@ func (c *Container) Create(ctx context.Context, r RunOpts, args ...string) error
}
func (c *Container) create(ctx context.Context, profileImage string, conf *container.Config, hostconf *container.HostConfig, netconf *network.NetworkingConfig) error {
- if c.runtime != "" {
+ if c.runtime != "" && c.runtime != "runc" {
// Use the image name as provided here; which normally represents the
// unmodified "basic/alpine" image name. This should be easy to grok.
c.profileInit(profileImage)
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()
})
}
}