diff --git a/runtime/networkdriver/portallocator/portallocator_test.go b/runtime/networkdriver/portallocator/portallocator_test.go index 356da855b..f01bcfc99 100644 --- a/runtime/networkdriver/portallocator/portallocator_test.go +++ b/runtime/networkdriver/portallocator/portallocator_test.go @@ -183,8 +183,17 @@ func TestPortAllocation(t *testing.T) { } port, err = RequestPort(ip, "tcp", 0) + if err != nil { + t.Fatal(err) + } port2, err := RequestPort(ip, "tcp", port+1) + if err != nil { + t.Fatal(err) + } port3, err := RequestPort(ip, "tcp", 0) + if err != nil { + t.Fatal(err) + } if port3 == port2 { t.Fatal("Requesting a dynamic port should never allocate a used port") }