Add 1s timeout after pods get ready, to ensure log generator produces output

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
This commit is contained in:
Maciej Szulik
2026-02-12 13:36:27 +01:00
parent 6e6107c9e9
commit c2bf995e96

View File

@@ -296,6 +296,9 @@ var _ = SIGDescribe("Kubectl logs", func() {
podOne := pods.Items[0].GetName()
podTwo := pods.Items[1].GetName()
ginkgo.By("sleep 1s to wait for log generator produce data after pods get ready")
time.Sleep(time.Second)
ginkgo.By("expecting logs from the default container from both pods in a deployment")
out := e2ekubectl.RunKubectlOrDie(ns, "logs", fmt.Sprintf("deploy/%s", deployName), "--all-pods")
gomega.Expect(strings.Contains(out, fmt.Sprintf("[pod/%s/container-2]", podOne))).To(gomega.BeTrueBecause("pod 1 container 2 log should be present"))
@@ -315,6 +318,9 @@ var _ = SIGDescribe("Kubectl logs", func() {
podOne := pods.Items[0].GetName()
podTwo := pods.Items[1].GetName()
ginkgo.By("sleep 1s to wait for log generator produce data after pods get ready")
time.Sleep(time.Second)
ginkgo.By("expecting logs from all containers from both pods in a deployment")
out := e2ekubectl.RunKubectlOrDie(ns, "logs", fmt.Sprintf("deploy/%s", deployName), "--all-pods", "--all-containers")
gomega.Expect(strings.Contains(out, fmt.Sprintf("[pod/%s/container-1]", podOne))).To(gomega.BeTrueBecause("pod 1 container 1 log should be present"))