-
Notifications
You must be signed in to change notification settings - Fork 69
Resolve hanging tests #98
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
Conversation
55dcc3a to
5feb318
Compare
jsvd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick, otherwise LGTM, thanks for not conceding to sleep :D
jsvd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we leverage a let here and simply use try { expect() } it would greatly reduce the amount of code needed for this change
jsvd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds a method that checks to make sure channels are created before they are published to in the tests.
The tests were hanging because there was a race condition:
The new method checks in a loop with a timeout that a channel exists so that events can be successfully published.
Here are some print statements from debugging that show that the first event popped from the queue is actually the second event:
Additionally, I found that if the event was attempted to be published and enqueued before the subscription had completed, the redis client would return a 0 from the publish method call. It should return 1 if the event was successfully published.
I've also updated the data that is published to be a json object, as there were intermittent errors:
Resolves #97