Skip to content

Commit 5de585f

Browse files
fix: add a delay for system event monitoring to start before pull completes as the run commands are async (#144)
Issue #, if available: *Description of changes:* This test fails around 50% of time in windows ``` should get real time events from command ``` adding the delay ensures system event process has started before the commands it monitors are running. This is a async call so this fix is required. *Testing done:* - [ x] I've reviewed the guidance in CONTRIBUTING.md #### License Acceptance By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Shubharanshu Mahapatra <[email protected]>
1 parent 3b69319 commit 5de585f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/events.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ func Events(o *option.Option) {
2828
ginkgo.It("should get real time events from command", func() {
2929
session := command.RunWithoutWait(o, "system", "events")
3030
defer session.Kill()
31+
32+
// Give time for the system events to be running and monitoring before pull is called.
33+
time.Sleep(5 * time.Second)
34+
3135
gomega.Expect(session.Out.Contents()).Should(gomega.BeEmpty())
3236
command.Run(o, "pull", localImages[defaultImage])
37+
3338
// allow propagation time
3439
gomega.Eventually(func(session *gexec.Session) string {
3540
return strings.TrimSpace(string(session.Out.Contents()))

0 commit comments

Comments
 (0)