test: Fix node integration tests sharing SDK initializations #5715
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.
While working on baggage changes and running the Node.js integration tests, I noticed that integrations were set up N times where N is the number of test suites there were.
I believe we do not want to share global context (i.e. SDK inits) across integration tests since that is not really simulating a real-world scenario.
By removing the
--runInBand
we will not run the tests in a single process anymore but in multiple worker processes. This is a bit slower so I also increased the test timeout. I raised it by quite a lot, hoping to reduce test flakes in the future.Also, there was some weird race condition/deadlock in the logic where we get a free port on the machine I aim to fix with this PR. TBH I don't quite know why it works but it seems to improve things when running locally.