Skip to content

Commit

Permalink
e2e: wait for all required pods before running test
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Mar 12, 2024
1 parent d04719d commit 255f2c0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions e2e/openssl/openssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ import (
)

// namespace the tests are executed in.
const namespaceEnv = "K8S_NAMESPACE"
const (
namespaceEnv = "K8S_NAMESPACE"

opensslFrontend = "openssl-frontend"
opensslBackend = "openssl-backend"
)

// TestOpenSSL runs e2e tests on the example OpenSSL deployment.
func TestOpenSSL(t *testing.T) {
Expand Down Expand Up @@ -76,6 +81,8 @@ func TestOpenSSL(t *testing.T) {

require := require.New(t)

require.NoError(c.WaitForDeployment(ctx, namespace, opensslFrontend))

addr, cancelPortForward, err := c.PortForwardPod(ctx, namespace, "port-forwarder-openssl-frontend", "443")
require.NoError(err)
defer cancelPortForward()
Expand All @@ -99,9 +106,6 @@ func TestOpenSSL(t *testing.T) {

c := kubeclient.NewForTest(t)

const opensslFrontend = "openssl-frontend"
const opensslBackend = "openssl-backend"

require.NoError(c.WaitForDeployment(ctx, namespace, opensslFrontend))
require.NoError(c.WaitForDeployment(ctx, namespace, opensslBackend))

Expand Down

0 comments on commit 255f2c0

Please sign in to comment.