Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running
node_modules/.bin/jest
(which is my current guess at the right way to run tests, see #77), it tries to run both test suites in parallel, but randomly ends with one of them passing and one being stuck at RUNS until Jest times out after 500 s.The reason seems to be that both suites try to run a server on port 3000. Only one can succeed, and will subsequently supply files for both. But when the suite that succeeds at starting the server is also the one that finishes first, it will take down the server at that time and leave the other one hanging, sometimes when it’s still trying to load tests from the server, sometimes when it tries to
close()
its own nonexistent server. (I didn’t completely study what happens in the latter case, I suspect there may be some exceptions/rejections involved that don’t make it to the console output.)The attached commit fixes this by running the two servers on different ports. With that, both suites now pass for me. (They take a long time though. Are all these
waitFor()
s really needed? The Puppeteer readme says “There’s no need for evil “sleep(1000)” calls in puppeteer scripts”.)Maybe there would also be a way of solving the problem using one server for both suites that is closed when all are done, but I’m unfamiliar with Jest and don’t know.