-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SecComms: Fix flaky tests #2154
base: main
Are you sure you want to change the base?
SecComms: Fix flaky tests #2154
Conversation
Fixes: confidential-containers#2153 Seperate ListenAndServe() of test servers to perform Listen() in the same thread as used by the client that rely on the server port to be open. Move to reuse tuntest network namespace test code rather that maintaining seperate network namespace test code for SecureComms. Signed-off-by: David Hadas <davidh@il.ibm.com>
test.HttpServer(forwarder.DefaultListenPort) | ||
s9009 := test.HttpServer(forwarder.DefaultListenPort) | ||
if s9009 == nil { | ||
t.Error("Failed - not create server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be Failed - could not create server
?
@@ -208,6 +208,9 @@ func TestPpssh(t *testing.T) { | |||
} | |||
|
|||
s := test.HttpServer("7105") | |||
if s == nil { | |||
t.Error("Failed - not create server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
if err := netlink.LinkSetUp(link); err != nil { | ||
t.Fatal(err) | ||
} | ||
ns, namespace := tuntest.NewNamedNS(t, "test-TestSshProxyWithNamespace") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these the right variable names as I assumed that ns
was short for namespace?
@@ -113,6 +109,9 @@ func TestSshProxy(t *testing.T) { | |||
serverSshPeer.Ready() | |||
|
|||
s := test.HttpServer("7020") | |||
if s == nil { | |||
t.Error("Failed - not create server") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, as it's in lots of places I think find and replace will be easier than me commenting everywhere.
Fixes: #2153
Seperate ListenAndServe() of test servers to perform Listen() in the same thread as used by the client that rely on the server port to be open.
Move to reuse tuntest network namespace test code rather that maintaining seperate network namespace test code for SecureComms.