Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidhadas
Copy link
Member

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.

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>
@davidhadas davidhadas requested a review from a team as a code owner November 14, 2024 15:29
test.HttpServer(forwarder.DefaultListenPort)
s9009 := test.HttpServer(forwarder.DefaultListenPort)
if s9009 == nil {
t.Error("Failed - not create server")
Copy link
Member

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")
Copy link
Member

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")
Copy link
Member

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")
Copy link
Member

@stevenhorsman stevenhorsman Nov 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

securecomms: TestSshProxyReverse test is flakey
3 participants