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

Stop running jest in parallel in integ tests #3517

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@ jobs:
if: matrix.specs == 'browserify'
run: "yarn build"

# We run the unit tests in parallel where possible. We don't bother for the integ tests,
# because there aren't many of them, so the improvement in run time is small, whilst the
# interleaving in the test output due to parallelism makes it very hard to read.
- name: Get number of CPU cores
id: cpu-cores
if: matrix.specs == 'unit'
uses: SimenB/github-actions-cpu-cores@410541432439795d30db6501fb1d8178eb41e502 # v1

- name: Run tests
run: |
yarn test \
--coverage=${{ env.ENABLE_COVERAGE }} \
--ci \
--max-workers ${{ steps.cpu-cores.outputs.count }} \
--max-workers ${{ steps.cpu-cores.outputs.count || 1 }} \
./spec/${{ matrix.specs }}
env:
JEST_SONAR_UNIQUE_OUTPUT_NAME: true
Expand Down
3 changes: 3 additions & 0 deletions spec/integ/matrix-client-syncing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1990,5 +1990,8 @@ describe("MatrixClient syncing (IndexedDB version)", () => {
idbHttpBackend.verifyNoOutstandingExpectation();
await idbClient.stopClient();
await idbHttpBackend.stop();

// force a save to indexeddb to make sure that we don't have any saves in flight when the test completes.
await idbClient.store.save(true);
Comment on lines +1993 to +1995
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once we limit jest to one worker, it realises that something is logging after shutdown, and complains about it. This makes sure that the test cleans up properly.

});
});