-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: some others flaky tests #1808
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1808 +/- ##
==========================================
+ Coverage 79.40% 79.45% +0.04%
==========================================
Files 24 25 +1
Lines 1423 1426 +3
Branches 332 332
==========================================
+ Hits 1130 1133 +3
Misses 212 212
Partials 81 81 ☔ View full report in Codecov by Sentry. |
@mcollina I recently started to randomly get this error on tests: https://github.com/mqttjs/MQTT.js/actions/runs/8143942807/job/22256983402?pr=1808#step:6:188
Any clue? |
@mcollina It seems this happens very randomly, initially I thought that it was caused by a leaked handler but I have been able to reproduce it locally by running tests on a single file and it fails after few seconds (when it happens). It makes me thinking about a possible race condition in tests but I have no clue where to look/debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@mcollina the issue is not fixed btw, I still get that error randomly... |
The tests are not properly isolated due to them running against the same broker and in the same process. porting them to tap or node:test would fix the latter, and a major refactoring would fix the former. Otherwise this is a goose chase. |
Maybe you forgot about: #1697 that exaxtly did such things
This is the method used: MQTT.js/test/helpers/port_list.ts Line 6 in e8462b3
Then each file requires a different port like: Line 11 in e8462b3
Line 2 in e8462b3
As you can see also the test suite are run in parallel |
@mcollina Ping |
@mcollina I will merge this for now as it makes some improvements I wish to include on next release, if you find some time to check the code and find a possible reason why that error happens let me know 🙏🏼 |
No description provided.