diff --git a/libnetwork/ipam/allocator_test.go b/libnetwork/ipam/allocator_test.go index 567c1d0b4e..a3799c8dc0 100644 --- a/libnetwork/ipam/allocator_test.go +++ b/libnetwork/ipam/allocator_test.go @@ -1141,19 +1141,21 @@ func benchMarkRequest(subnet string, b *testing.B) { } } -func BenchmarkRequest_24(b *testing.B) { - a, _ := getAllocator(true) - benchmarkRequest(b, a, "10.0.0.0/24") -} +func BenchmarkRequest(b *testing.B) { -func BenchmarkRequest_16(b *testing.B) { - a, _ := getAllocator(true) - benchmarkRequest(b, a, "10.0.0.0/16") -} + subnets := []string{ + "10.0.0.0/24", + "10.0.0.0/16", + "10.0.0.0/8", + } -func BenchmarkRequest_8(b *testing.B) { - a, _ := getAllocator(true) - benchmarkRequest(b, a, "10.0.0.0/8") + for _, subnet := range subnets { + name := fmt.Sprintf("%vSubnet", subnet) + b.Run(name, func(b *testing.B) { + a, _ := getAllocator(true) + benchmarkRequest(b, a, subnet) + }) + } } func TestAllocateRandomDeallocate(t *testing.T) {