Skip to content

Commit

Permalink
Wait on final state instead intermediate
Browse files Browse the repository at this point in the history
This will change the kubectl wait command to wait till
phase is succeeded instead of running as running is intermediate
state and if changes to succeeded fast, it ends up in timeout
  • Loading branch information
piyush-garg committed Jan 15, 2025
1 parent d3b8050 commit 7f1263a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/eventlistener/eventListener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestEventListenerLogsE2E(t *testing.T) {
createResources(t, c, namespace)
kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("eventlistener/eventlistener_log.yaml"))
// Wait for pods to run and crash for next test
kubectl.MustSucceed(t, "wait", "--for=jsonpath=.status.phase=Running", "pod", "-n", namespace, "--timeout=2m", "--all")
kubectl.MustSucceed(t, "wait", "--for=jsonpath=.status.phase=Succeeded", "pod", "-n", namespace, "--timeout=2m", "--all")

t.Run("Get logs of EventListener", func(t *testing.T) {
res := tkn.MustSucceed(t, "eventlistener", "logs", elName, "-t", "1")
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestEventListener_v1beta1LogsE2E(t *testing.T) {
createResources(t, c, namespace)
kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("eventlistener/eventlistener_v1beta1_log.yaml"))
// Wait for pods to run and crash for next test
kubectl.MustSucceed(t, "wait", "--for=jsonpath=.status.phase=Running", "pod", "-n", namespace, "--timeout=2m", "--all")
kubectl.MustSucceed(t, "wait", "--for=jsonpath=.status.phase=Succeeded", "pod", "-n", namespace, "--timeout=2m", "--all")

t.Run("Get logs of EventListener", func(t *testing.T) {
res := tkn.MustSucceed(t, "eventlistener", "logs", elName, "-t", "1")
Expand Down

0 comments on commit 7f1263a

Please sign in to comment.