From c3a5b23c59edc8b38a9687ed672de19da55163d7 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Wed, 10 May 2023 17:47:43 +0200 Subject: [PATCH] Increase the timeout for Podman tests to an arbitrary value of 10s Some tests did not pass because the Podman client did not initialize in 1s; I guess because we are running a lot of Podman commands in parallel? This should hopefully improve this situation. --- tests/helper/helper_generic.go | 10 ++++++++++ tests/integration/cmd_dev_test.go | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/helper/helper_generic.go b/tests/helper/helper_generic.go index c5d07df7446..b901799d7e5 100644 --- a/tests/helper/helper_generic.go +++ b/tests/helper/helper_generic.go @@ -214,6 +214,16 @@ func CommonBeforeEach() CommonVar { os.Setenv("KUBECONFIG", kubeconfig.Name()) if NeedsPodman(specLabels) { + originalPodmanCmdInitTimeout, present := os.LookupEnv("PODMAN_CMD_INIT_TIMEOUT") + DeferCleanup(func() { + if present { + Expect(os.Setenv("PODMAN_CMD_INIT_TIMEOUT", originalPodmanCmdInitTimeout)) + } else { + Expect(os.Unsetenv("PODMAN_CMD_INIT_TIMEOUT")).ShouldNot(HaveOccurred()) + } + }) + Expect(os.Setenv("PODMAN_CMD_INIT_TIMEOUT", "10s")).ShouldNot(HaveOccurred()) + // Generate a dedicated containers.conf with a specific namespace GenerateAndSetContainersConf(commonVar.ConfigDir) } diff --git a/tests/integration/cmd_dev_test.go b/tests/integration/cmd_dev_test.go index 36ae7363887..47cd00be40c 100644 --- a/tests/integration/cmd_dev_test.go +++ b/tests/integration/cmd_dev_test.go @@ -109,7 +109,10 @@ echo "$@" devSession, _, stderrBytes, _, err = helper.StartDevMode(helper.DevSessionOpts{ RunOnPodman: false, CmdlineArgs: []string{"-v", "3"}, - EnvVars: []string{"PODMAN_CMD=" + delayer}, + EnvVars: []string{ + "PODMAN_CMD=" + delayer, + "PODMAN_CMD_INIT_TIMEOUT=1s", + }, }) Expect(err).ShouldNot(HaveOccurred()) defer devSession.Kill()