-
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(test): close all open connections in abstract_client test #1917
Conversation
@MaximoLiberata Let me know when this is ready for review |
@robertsLando How can I configure my computer to run this test https://github.com/mqttjs/MQTT.js/actions/runs/10217524082/job/28271502928?pr=1917? It's a new error for me. I don't know how this change 8d154b0 directly affects the new error |
I have a feel that's happening because I removed mqtt from deps in one of the last commits I pushed to master, it's just a tought but I'm not on my PC right now so cannot say much more. In order to run it just check how workflow is setup, if on windows you may need to use WSL |
I could to run the test. The test might throw an error because |
We could switch to a self hosted broker like I did for browser tests with aedes cli? |
Sincerely I don't know. I could try to move it to a self hosted broker later. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1917 +/- ##
==========================================
+ Coverage 80.96% 81.24% +0.27%
==========================================
Files 24 24
Lines 1408 1466 +58
Branches 331 348 +17
==========================================
+ Hits 1140 1191 +51
- Misses 185 191 +6
- Partials 83 84 +1 ☔ View full report in Codecov by Sentry. |
This reverts commit 2dc39f2.
I couldn't to reproduce the hanging bug of the keepalive test in my computer, but I could to reproduce it only in the GitHub Actions. It seems the test fails because the Case 1 - GitHub Action Case 1 - Test Pass
Case 2 - Test Fails
@robertsLando Do you have any idea why client do not publish the packages? |
Usually in such situations the reason is a race condition, using fake timers there has been a pain, I had to put clock.tick here and there in order to prevent this kind of issues, my feel is that sometimes the stack trace (in slower machines like GH actions) could be a bit different for some reason and the clock ticks are not enough in order to trigger the next tick from the call queue so the event is not emitted. A possible (dirty) solution could be to call a clock.tick inside an interval in order to make the process go on when this happens Sometinh likE: // Use a real timer to advance the fake clock
let tickInterval = setInterval(() => {
clock.tick(1);
}, 100); Also I would add a timeout to the test so in case it hangs it allows to continue others tests |
I don't know if this will throw an idea to resolve the bug, but these are the mqtt logs (using GH Action - Test Pass And here is the difference between two mqtt logs when Pass and when Fails https://www.diffchecker.com/902zCyLn/ (The left side is when Pass and the right side is when fails) Also,
|
FYI you can check this box when running tests in order to see debug logs: Anyway I'm quite sure the issue is related to the thing I told you here: #1917 (comment) |
@robertsLando I think I could to prevent or fix the hanging bug in GitHub Actions |
@robertsLando Could you check the changes, please? I think we got it, I ran 100 GH Actions and not one of them failed. I removed or changed some GH Actions |
@MaximoLiberata Sorry but I have been super busy! Seems you found it so, well done! :) |
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 🚀
Continue the work made in #1911