diff --git a/tests/events.go b/tests/events.go index ec79249..847a680 100644 --- a/tests/events.go +++ b/tests/events.go @@ -4,6 +4,8 @@ package tests import ( + "time" + "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" @@ -26,7 +28,11 @@ func Events(o *option.Option) { defer session.Kill() gomega.Expect(session.Out.Contents()).Should(gomega.BeEmpty()) command.Run(o, "pull", defaultImage) - gomega.Expect(session.Out.Contents()).Should(gomega.ContainSubstring(defaultImage)) + // allow propagation time + gomega.Eventually(session.Out.Contents()). + WithTimeout(15 * time.Second). + WithPolling(1 * time.Second). + Should(gomega.ContainSubstring(defaultImage)) }) }) } diff --git a/tests/logs.go b/tests/logs.go index e05b568..62d72b5 100644 --- a/tests/logs.go +++ b/tests/logs.go @@ -99,8 +99,11 @@ func Logs(o *option.Option) { defer session.Kill() gomega.Expect(session.Out.Contents()).Should(gomega.BeEmpty()) command.Run(o, "exec", testContainerName, "sh", "-c", fmt.Sprintf("echo %s >> /proc/1/fd/1", newLog)) - output := strings.TrimSpace(string(session.Out.Contents())) - gomega.Expect(output).Should(gomega.Equal(newLog)) + // allow propagation time + gomega.Eventually(strings.TrimSpace(string(session.Out.Contents()))). + WithTimeout(15 * time.Second). + WithPolling(1 * time.Second). + Should(gomega.Equal(newLog)) }) } })