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

test: server.close uses callbacks, not promises #2178

Merged
1 commit merged into from Aug 20, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented Aug 19, 2021

In some tests, we assume server.close uses promises. It doesn't. Meaning in those tests we end the test before the server closes, causing possible issues (e.g. we don't randomise the port so we're bound to get port conflicts as a race condition).

I used a mixture of callbacks and promise wrappers because that's how it currently is for similar tests. It'll make migrations easier in the future.

I considered adding an API to fakeServer to support promises but it'll change a lot of tests and some are using a different "fake server" called cli-server. Ideally we should migrate cli-server usage to fakeServer then make API changes to avoid duplication.

@ghost ghost requested review from a team as code owners August 19, 2021 15:52
@ghost ghost requested a review from steph-herd-snyk-pm August 19, 2021 15:52
@github-actions
Copy link
Contributor

Messages
📖

This PR will not trigger a new version. It doesn't include any commit message with feat or fix.

Generated by 🚫 dangerJS against 1522c5f

@ghost ghost merged commit e7c314f into master Aug 20, 2021
@ghost ghost deleted the test/server-close branch August 20, 2021 10:29
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant