-
Notifications
You must be signed in to change notification settings - Fork 154
fix: make tests independent of execution order #1378
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
Open
fabiovincenzi
wants to merge
13
commits into
finos:main
Choose a base branch
from
fabiovincenzi:fix/test-shuffle-independence
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: make tests independent of execution order #1378
fabiovincenzi
wants to merge
13
commits into
finos:main
from
fabiovincenzi:fix/test-shuffle-independence
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…proxy into failing-tests
✅ Deploy Preview for endearing-brigadeiros-63f9d0 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1378 +/- ##
==========================================
+ Coverage 80.40% 81.43% +1.03%
==========================================
Files 65 65
Lines 4608 4644 +36
Branches 775 791 +16
==========================================
+ Hits 3705 3782 +77
+ Misses 888 847 -41
Partials 15 15 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes: #1362.
Make tests independent of execution order so they pass with
--sequence.shuffle. The root causes were shared mutable state across tests running in a single process: DB records, mock leaks, module cache, network ports, and filesystem artifacts.fs.rm()with callback was not awaited, causing race conditions. Switched to awaitfs.promises.rm().server.listen()was not awaited and errors were silently ignored. Wrapped in a Promise with proper error handling._httpServerwas not reset to null after close, preventing clean restarts.res.send(), so clients received200before the proxy was ready. Moved restart before the response, consistent with the DELETE route.mockClear()fromafterAlltobeforeEach.vi.doUnmock('fs')beforevi.resetModules()sincedoMockpersists across module resets.vi.restoreAllMocks()withvi.clearAllMocks()to preserve module-level spies.vi.resetModules()beforevi.doMockto ensure fresh imports.on()method to mock HTTP servers.loginAsAdmin()helper so each test gets its own session cookie.beforeAll, addedensureTestRepoExists()helper, proper cleanup withproxy.stop()andService.stop().