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

Avoid timeouts when listening on a socket in tests #398

merged 1 commit into from Jun 4, 2019


None yet
1 participant
Copy link

commented Jun 4, 2019

This is an attempt to fix #386.

I worry that in cases where we are timing out, the attempt to listen might actually be producing an error, and we are simply dropping this error on the floor. If that is what's happening, we should now surface the error by rejecting the promise returned by the beforeEach block instead of just timing out in a waitsFor function.

I'm also waiting for the server to fully close in the afterEach block, just to be sure we stop listening before attempting to listen again. This seems unlikely, but it's more correct to wait for this anyway.

Investigate and maybe avoid timeouts in test
Instead of using waitsFor, we return a promise from the beforeEach 
function. This promise gets rejected if there is an error listening, so 
hopefully we will see that error instead of a timeout if there are 
issues listening.

@nathansobo nathansobo merged commit d8fa4ad into master Jun 4, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@nathansobo nathansobo deleted the ns/try-to-fix-flaky branch Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.