-
Notifications
You must be signed in to change notification settings - Fork 80
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
Generic MQTT improvements #1184
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1184 +/- ##
==========================================
+ Coverage 76.66% 76.74% +0.07%
==========================================
Files 80 82 +2
Lines 16813 16946 +133
Branches 1618 1632 +14
==========================================
+ Hits 12890 13005 +115
- Misses 3893 3911 +18
Partials 30 30 ☔ View full report in Codecov by Sentry. |
It seems it didn't let me try to play with it little more... |
In b79e59b I tried to force qos 2 for every event. I suspect that the test is falling due to the fact that by default the event is published with qos 0 and therefore we lost some events. If it works I then try to improve the solution and make it more generic. |
Nvm I must have blanked for a moment. It is still MQTT. (but locally windows the binding-file is falling I have to investigate my setup). |
9321d07
to
53a6f73
Compare
It is not just failing locally.. I have seen it failing also on the CI |
Note that while we get all green here. Locally, File Client Implementation
✔ should be able to write and read files using URI scheme file:/// with Content-Type application/json
1) should be able to write and read files using URI scheme file:/// with no Content-Type
✔ should be able to write and read files using URI scheme file:/// with Content-Type text/plain
✔ should be able to write and read files using URI scheme file:// with Content-Type application/json
✔ should be able to write and read files using URI scheme file:// with no Content-Type
✔ should be able to write and read files using URI scheme file:// with Content-Type text/plain
5 passing (15ms)
1 failing
1) File Client Implementation
should be able to write and read files using URI scheme file:/// with no Content-Type:
AssertionError: expected undefined to deeply equal { foo: 'bar' }
at path\to\node-wot\binding-file\test\file-client-test.ts:90:43
at Generator.next (<anonymous>)
at fulfilled (test\file-client-test.ts:5:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5) |
With #1185, the file-client related issues will hopefully be resolved soon :) |
@egekorkan do you think you can review this MQTT PR? |
10244e3
to
712ec51
Compare
I rebased with the master to start on the changes that @JKRhb made. Let's wait for the final greenlight from the CI/CD and @egekorkan. |
Ok CI/CD is still angry. The funny thing is that I have a Windows setup with Node 18.x and even if I run the tests sequentially like the following: for i in {1..100}; do npm run test -w packages/binding-mqtt; done I get 100% success rate. I think we need more information if we want to know more about why is falling. Could it be that it finds some occupied port and just waits there? Currently, we are firing 5 events and the code is waiting for 3... with qos 2 it is possible that we lost so many packages (they shouldn't be lost at all!). Any idea how to debug better? Shall we activate |
Hmm, that's very strange :/
That sounds good! Maybe we can somehow configure the CI to re-run failed workflow runs with logging enabled in general? Could be useful to determine the source of problems more quickly. Edit: Just found an Action that could be used for that: https://github.com/marketplace/actions/retry-step#run-different-command-after-first-failure |
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.
Thanks a lot @relu91. The changes are many but all on the right direction!
It could be handy yes, however, I'd probably need to enable debug for the whole node-wot package (i.e. |
I've just opened #1189 as an experimental PR to test it out :) |
Ok, I review the current status and I think we can merge it. There is still the problem of how properly generate forms in the mqtt broker following user preference (i.e. how the user can configure |
Given the latest problems that MQTT gave, I tried to revamp it a little bit the implementation in the hope that it would cause fewer problems and would be more maintainable. I took three steps:
async
methods -> cleaner implementation and cover corner cases where we forgot to use callbacks.mqv:filter
you can't subscribe to two events at the same time. I hope this is a corner case... if anybody else has suggestions on this let me know!Meanwhile I hope that this new changes also solves the problems in MacOS