From 8d7ab801415af47d45b42c4bc7aae48e6d851da9 Mon Sep 17 00:00:00 2001 From: arshia-rgh Date: Wed, 3 Dec 2025 17:43:34 +0330 Subject: [PATCH] fix(testsuite):fix flaky test by ensure port is free to use Signed-off-by: arshia-rgh --- pkg/port/testsuite/testsuite.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/pkg/port/testsuite/testsuite.go b/pkg/port/testsuite/testsuite.go index 98396089..1fc072c1 100644 --- a/pkg/port/testsuite/testsuite.go +++ b/pkg/port/testsuite/testsuite.go @@ -138,21 +138,10 @@ func TestProto(t *testing.T, proto string, d port.ParentDriver) { func testProtoWithPID(t *testing.T, proto string, d port.ParentDriver, childPID int) { ensureDeps(t, "nsenter", "ip", "nc") - // [child]parent + pairs := map[int]int{ - // FIXME: flaky - 80: (childPID + 80) % 60000, - 8080: (childPID + 8080) % 60000, - } - if proto == "tcp" { - for _, parentPort := range pairs { - var d net.Dialer - d.Timeout = 50 * time.Millisecond - _, err := d.Dial(proto, fmt.Sprintf("127.0.0.1:%d", parentPort)) - if err == nil { - t.Fatalf("port %d is already used?", parentPort) - } - } + 80: 0, + 8080: 0, } t.Logf("namespace pid: %d", childPID)