Skip to content

Commit

Permalink
fix race condition on e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Turrado <[email protected]>
  • Loading branch information
JorTurFer committed Jan 4, 2024
1 parent d9198b9 commit 9d31fd5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/utils/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os/exec"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

. "github.com/kedacore/http-add-on/tests/helper"
Expand Down Expand Up @@ -101,9 +102,17 @@ func TestSetupKEDA(t *testing.T) {
_, err = ExecuteCommand("helm repo update kedacore")
require.NoErrorf(t, err, "cannot update kedacore helm repo - %s", err)

_, err = ExecuteCommand(fmt.Sprintf("helm upgrade --install keda kedacore/keda --namespace %s --wait --set extraArgs.keda.kube-api-qps=200 --set extraArgs.keda.kube-api-burst=300",
_, err = ExecuteCommand(fmt.Sprintf("helm upgrade --install keda kedacore/keda --namespace %s --set extraArgs.keda.kube-api-qps=200 --set extraArgs.keda.kube-api-burst=300",
KEDANamespace))
require.NoErrorf(t, err, "cannot install KEDA - %s", err)

KubeClient = GetKubernetesClient(t)
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, "keda-operator", KEDANamespace, 1, 30, 6),
"replica count should be 1 after 3 minutes")
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, "keda-operator-metrics-apiserver", KEDANamespace, 1, 30, 6),
"replica count should be 1 after 3 minutes")
assert.True(t, WaitForDeploymentReplicaReadyCount(t, KubeClient, "keda-admission-webhooks", KEDANamespace, 1, 30, 6),
"replica count should be 1 after 3 minutes")
}

func TestDeployKEDAHttpAddOn(t *testing.T) {
Expand Down

0 comments on commit 9d31fd5

Please sign in to comment.