Merge pull request #23979 from edsantiago/workaround-remote-events-flake

CI: e2e: workaround for events out-of-sequence flake
This commit is contained in:
openshift-merge-bot[bot]
2024-09-17 12:49:19 +00:00
committed by GitHub

View File

@@ -262,12 +262,22 @@ var _ = Describe("Podman events", func() {
result = podmanTest.Podman([]string{"events", "--stream=false", "--since", "30s"}) result = podmanTest.Podman([]string{"events", "--stream=false", "--since", "30s"})
result.WaitWithDefaultTimeout() result.WaitWithDefaultTimeout()
Expect(result).Should(ExitCleanly()) Expect(result).Should(ExitCleanly())
lines := result.OutputToStringArray()
Expect(lines).To(HaveLen(5)) eventDetails := fmt.Sprintf(" %s (container=%s, name=%s)", ctrID, ctrID, network)
Expect(lines[3]).To(ContainSubstring("network connect")) // Workaround for #23634, event order not guaranteed when remote.
Expect(lines[3]).To(ContainSubstring(fmt.Sprintf("(container=%s, name=%s)", ctrID, network))) // Although the issue is closed, the bug is a real one. It seems
Expect(lines[4]).To(ContainSubstring("network disconnect")) // unlikely ever to be fixed.
Expect(lines[4]).To(ContainSubstring(fmt.Sprintf("(container=%s, name=%s)", ctrID, network))) if IsRemote() {
lines := result.OutputToString()
Expect(lines).To(ContainSubstring("network connect" + eventDetails))
Expect(lines).To(ContainSubstring("network disconnect" + eventDetails))
Expect(lines).To(MatchRegexp(" network connect .* network disconnect "))
} else {
lines := result.OutputToStringArray()
Expect(lines).To(HaveLen(5))
Expect(lines[3]).To(ContainSubstring("network connect" + eventDetails))
Expect(lines[4]).To(ContainSubstring("network disconnect" + eventDetails))
}
}) })
It("podman events health_status generated", func() { It("podman events health_status generated", func() {