From b468e4eb1cdfaf0a0e787b88d3b1ce5a8dfc1788 Mon Sep 17 00:00:00 2001 From: Gunju Kim Date: Wed, 6 Sep 2023 23:36:44 +0900 Subject: [PATCH] e2e_node: Assign enough time to finish the postStart hook This deflakes the "Containers Lifecycle should not launch second container before PostStart of the first container completed" test by assigning enough time to finish the postStart hook. --- test/e2e_node/container_lifecycle_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/e2e_node/container_lifecycle_test.go b/test/e2e_node/container_lifecycle_test.go index 1240ff8f6af..97e72ab5813 100644 --- a/test/e2e_node/container_lifecycle_test.go +++ b/test/e2e_node/container_lifecycle_test.go @@ -236,7 +236,12 @@ var _ = SIGDescribe("[NodeConformance] Containers Lifecycle ", func() { Name: regular1, Image: busyboxImage, Command: ExecCommand(regular1, execCommand{ - Delay: 2, + // Allocate sufficient time for its postStart hook + // to complete. + // Note that we've observed approximately a 2s + // delay before the postStart hook is called. + // 10s > 1s + 2s(estimated maximum delay) + other possible delays + Delay: 10, ExitCode: 0, }), Lifecycle: &v1.Lifecycle{ @@ -334,7 +339,12 @@ var _ = SIGDescribe("[NodeConformance] Containers Lifecycle ", func() { Name: regular1, Image: busyboxImage, Command: ExecCommand(regular1, execCommand{ - Delay: 2, + // Allocate sufficient time for its postStart hook + // to complete. + // Note that we've observed approximately a 2s + // delay before the postStart hook is called. + // 10s > 1s + 2s(estimated maximum delay) + other possible delays + Delay: 10, ExitCode: 0, }), Lifecycle: &v1.Lifecycle{