From 7fc7b589a6fd1b8dbe04b3aaaa04b1f3d7703372 Mon Sep 17 00:00:00 2001 From: "GeunSam2 (Gray)" Date: Thu, 13 Apr 2023 22:25:42 +0900 Subject: [PATCH] fix: Flaky test about lifecycle hooks. Fixes #10897 (#10898) Signed-off-by: GeunSam2 --- test/e2e/hooks_test.go | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/test/e2e/hooks_test.go b/test/e2e/hooks_test.go index 56ee4b32d2d4..3e4480f837d2 100644 --- a/test/e2e/hooks_test.go +++ b/test/e2e/hooks_test.go @@ -45,7 +45,8 @@ spec: - name: argosay container: image: argoproj/argosay:v2 - command: ["/argosay"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay"] `).When(). SubmitWorkflow(). WaitForWorkflow(fixtures.ToBeSucceeded). @@ -88,12 +89,14 @@ spec: - name: argosay container: image: argoproj/argosay:v2 - command: ["/argosay", "sleep 5", "exit 1"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay; exit 1"] - name: hook container: image: argoproj/argosay:v2 - command: ["/argosay"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay"] `).When(). SubmitWorkflow(). WaitForWorkflow(fixtures.ToBeFailed). @@ -143,7 +146,8 @@ spec: - name: argosay container: image: argoproj/argosay:v2 - command: ["/argosay"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay"] `).When(). SubmitWorkflow(). WaitForWorkflow(fixtures.ToBeSucceeded). @@ -192,11 +196,13 @@ spec: - name: argosay container: image: argoproj/argosay:v2 - command: ["/argosay", "sleep 5", "exit 1"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay; exit 1"] - name: hook container: image: argoproj/argosay:v2 - command: ["/argosay"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay"] `).When(). SubmitWorkflow(). WaitForWorkflow(fixtures.ToBeFailed). @@ -248,7 +254,8 @@ spec: - name: argosay container: image: argoproj/argosay:v2 - command: ["/argosay"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay"] `).When(). SubmitWorkflow(). WaitForWorkflow(fixtures.ToBeSucceeded). @@ -298,11 +305,13 @@ spec: - name: argosay container: image: argoproj/argosay:v2 - command: ["/argosay", "sleep 5", "exit 1"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay; exit 1"] - name: hook container: image: argoproj/argosay:v2 - command: ["/argosay"] + command: ["/bin/sh", "-c"] + args: ["/bin/sleep 1; /argosay"] `).When(). SubmitWorkflow(). WaitForWorkflow(fixtures.ToBeFailed).