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

fix: Tap Test improvements/fixes #4145

Closed
wants to merge 4 commits into from
Closed

Conversation

candrews
Copy link
Contributor

What does this PR do?

Supports parallelism in the tap tests by using different XDG Configuration directories and fakeserver ports for each tap test process.
Also fixes a few minor problems in the tap tests.

Where should the reviewer start?

Run the tap tests.

How should this be manually tested?

npm run test:tap

Any background context you want to provide?

I'm splitting out some of the changes in #3875 into separate PRs for easier review/merging.

What are the relevant tickets?

n/a

Screenshots

n/a

Additional questions

n/a

The output can contain ansi escape sequences which must be stripped to
ensure consistent test behavior.
node-tap automatically runs tests in parallel instead of one at at time.
See: https://node-tap.org/changelog/#130---2019-04-25

node-tap 15.0 changed the behavior of teardown, making it asynchronous.
See: https://node-tap.org/changelog/#150---2021-03-30

Therefore one tap tests may be running while another runs or while
another has finished running but hasn't finished executing teardown.
With all tests using the same port, 12345, multiple tests would try to
start a server on that port at the same time resulting it tests randomly
failing with:
listen EADDRINUSE: address already in use :::12345
Using a different port per process eliminates this problem.

See: https://node-tap.org/docs/api/parallel-tests/
Since tap tests can run in parallel, if multiple tap tests use the same
configuration directory and they try to update configuration, they'll
overwrite each other and end up in indeterminate states, causing
unexpected test failures.
@candrews candrews requested review from a team as code owners October 17, 2022 18:57
@candrews
Copy link
Contributor Author

@PeterSchafer hopefully this small PR passes all tests and is very easy to merge :)

@candrews candrews changed the title Tap Test improvements/fixes fix: Tap Test improvements/fixes Oct 17, 2022
@thisislawatts
Copy link
Member

Parallelism support added in: #4989

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants