Skip to content

Commit

Permalink
Increase the timeout for Podman tests to an arbitrary value of 10s
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rm3l committed May 10, 2023
1 parent 4cabec2 commit c3a5b23
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/helper/helper_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
5 changes: 4 additions & 1 deletion tests/integration/cmd_dev_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c3a5b23

Please sign in to comment.