Skip to content

Commit

Permalink
Fix e2e test for eventlistener
Browse files Browse the repository at this point in the history
This patch increase wait timeout to 5 minutes as
earliar e2e test was failing due to timeout

Signed-off-by: Shiv Verma <[email protected]>
  • Loading branch information
pratap0007 committed Jan 15, 2025
1 parent 1842fa8 commit f250aa9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/e2e/eventlistener/eventListener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestEventListenerE2E(t *testing.T) {
createResources(t, c, namespace)
kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("eventlistener/eventlistener.yaml"))
// Wait for pods to become available for next test
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=2m", "--all")
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=5m", "--all")

t.Run("Assert if EventListener AVAILABLE status is true", func(t *testing.T) {
res := tkn.MustSucceed(t, "eventlistener", "list")
Expand All @@ -57,7 +57,7 @@ func TestEventListenerE2E(t *testing.T) {
t.Logf("Scaling EventListener %s to 3 replicas in namespace %s", elName, namespace)
kubectl.MustSucceed(t, "apply", "-f", helper.GetResourcePath("eventlistener/eventlistener-multi-replica.yaml"))
// Wait for pods to become available for next test
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=2m", "--all")
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=5m", "--all")
}

func TestEventListenerLogsE2E(t *testing.T) {
Expand All @@ -74,7 +74,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=Running", "pod", "-n", namespace, "--timeout=5m", "--all")

t.Run("Get logs of EventListener", func(t *testing.T) {
res := tkn.MustSucceed(t, "eventlistener", "logs", elName, "-t", "1")
Expand Down Expand Up @@ -109,7 +109,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=Running", "pod", "-n", namespace, "--timeout=5m", "--all")

t.Run("Get logs of EventListener", func(t *testing.T) {
res := tkn.MustSucceed(t, "eventlistener", "logs", elName, "-t", "1")
Expand Down Expand Up @@ -144,7 +144,7 @@ func TestEventListener_v1beta1E2E(t *testing.T) {
createResources(t, c, namespace)
kubectl.MustSucceed(t, "create", "-f", helper.GetResourcePath("eventlistener/eventlistener_v1beta1.yaml"))
// Wait for pods to become available for next test
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=2m", "--all")
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=5m", "--all")

t.Run("Assert if EventListener AVAILABLE status is true", func(t *testing.T) {
res := tkn.MustSucceed(t, "eventlistener", "list")
Expand All @@ -155,7 +155,7 @@ func TestEventListener_v1beta1E2E(t *testing.T) {
t.Logf("Scaling EventListener %s to 3 replicas in namespace %s", elName, namespace)
kubectl.MustSucceed(t, "apply", "-f", helper.GetResourcePath("eventlistener/eventlistener_v1beta1-multi-replica.yaml"))
// Wait for pods to become available for next test
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=2m", "--all")
kubectl.MustSucceed(t, "wait", "--for=condition=Ready", "pod", "-n", namespace, "--timeout=5m", "--all")
}

func createResources(t *testing.T, c *framework.Clients, namespace string) {
Expand Down

0 comments on commit f250aa9

Please sign in to comment.