Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow propagation time for async conditions #111

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tests/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package tests

import (
"time"

"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"

Expand All @@ -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))
})
})
}
7 changes: 5 additions & 2 deletions tests/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
}
})
Expand Down
Loading