Skip to content

Fix Test TestEventChannel_OutputFormat #1468

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

Merged
merged 3 commits into from
Sep 2, 2020
Merged

Conversation

guscarreon
Copy link
Contributor

TestEventChannel_OutputFormat found in analytics/pubstack/eventchannel/eventchannel_test.go is sometimes failing, specially when run by Travis, very likely because of the concurrent functionality of the EventChannelmethods. This PR corrects said test case and adds assertions.

eventChannel.Push([]byte("two"))
eventChannel.flush()

time.Sleep(10 * time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving the sleep before the flush (and Close call in TestEventChannelPushAndClose) to ensure the messages are pushed before calling flush.

eventChannel.Push([]byte("two"))
eventChannel.flush()

time.Sleep(10 * time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we change this to 1 ms? If we need to sleep due wait for go routines, IMHO it should be a minimal amount of time.

@mansinahar mansinahar merged commit f350cda into prebid:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants