mirror of
https://github.com/containers/podman.git
synced 2025-11-30 18:18:18 +08:00
Merge pull request #23979 from edsantiago/workaround-remote-events-flake
CI: e2e: workaround for events out-of-sequence flake
This commit is contained in:
@@ -262,12 +262,22 @@ var _ = Describe("Podman events", func() {
|
||||
result = podmanTest.Podman([]string{"events", "--stream=false", "--since", "30s"})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result).Should(ExitCleanly())
|
||||
lines := result.OutputToStringArray()
|
||||
Expect(lines).To(HaveLen(5))
|
||||
Expect(lines[3]).To(ContainSubstring("network connect"))
|
||||
Expect(lines[3]).To(ContainSubstring(fmt.Sprintf("(container=%s, name=%s)", ctrID, network)))
|
||||
Expect(lines[4]).To(ContainSubstring("network disconnect"))
|
||||
Expect(lines[4]).To(ContainSubstring(fmt.Sprintf("(container=%s, name=%s)", ctrID, network)))
|
||||
|
||||
eventDetails := fmt.Sprintf(" %s (container=%s, name=%s)", ctrID, ctrID, network)
|
||||
// Workaround for #23634, event order not guaranteed when remote.
|
||||
// Although the issue is closed, the bug is a real one. It seems
|
||||
// unlikely ever to be fixed.
|
||||
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() {
|
||||
|
||||
Reference in New Issue
Block a user