Skip to content

Commit

Permalink
fix: allow propagation time for async conditions
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Alvarez <[email protected]>
  • Loading branch information
pendo324 committed Jan 12, 2024
1 parent 0921b98 commit 84a85f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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))
})
})
}
6 changes: 5 additions & 1 deletion tests/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ func Logs(o *option.Option) {
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(output).
WithTimeout(15 * time.Second).
WithPolling(1 * time.Second).
Should(gomega.Equal(newLog))
})
}
})
Expand Down

0 comments on commit 84a85f0

Please sign in to comment.