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.
Purpose
The tests have been failing for about three months and I didn't notice at all (?)
This wasn't an issue with the app, which always built properly, but with the automated test suite (a.k.a. puppeteer checking that the thing opens when the app is built and ran with
next start
)Approach and changes
This is a bit of a mess. Looks like at the core it's an issue that a
start-server-and-test
subdependency (wait-on
) has with Node.js v18 (so might have started when we bumped Node.js versions in our version matrices?). Ref: jeffbski/wait-on#137Expectedly, a lot of people seem to be running into the issue and are reporting this in the
start-server-amd-test
repo. This issue thread for example: bahmutov/start-server-and-test#181 suggests various solutions, which I've tried locally without success.In the end what worked was the opposite of one of the suggested solutions: switching the watched URL from
localhost:3000
to0.0.0.0:3000
. This worked locally, worked in CI (ran the workflow on this branch), so I think it's safe to merge.I don't really understand why this solves it but this seems like a viable short-term fix—long term, if this doesn't get fixed upstream and starts happening again, I'd suggest exploring alternatives to
start-server-and-test
(which would probably be more straightforward and cleaner than attempting to patch the subdep).Definition of done