-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[mqtt][homie] fix integration tests #5915
Conversation
Travis tests were successfulHey @J-N-K, |
When I initially wrote the tests, it worked with moquette. Since then we have updated moquette from 0.10 to 0.11 and also updated paho. I guess a simple retained topic publish subscribe integration test could be part of the moquette mqtt broker bundle to make sure that this is not the culprit? |
...binding.mqtt.homie.tests/src/main/java/org/openhab/binding/mqtt/HomieImplementationTest.java
Outdated
Show resolved
Hide resolved
@openhab/2-x-add-ons-maintainers How should we proceed here? Obviously the bug is external and will affect everyone using the internal broker. |
Found the bug in moquette for that: moquette-io/moquette#489 |
Awesome. The h2 persistence was not fixed by that PR though :/ |
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. A new moquette release, yeah.
assertTrue("Connection " + connection.getClientId() + " not retrieving all topics", | ||
c.await(1000, TimeUnit.MILLISECONDS)); | ||
// four topics are not under /testnode ! | ||
CountDownLatch c = new CountDownLatch(registeredTopics - 4); |
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.
Hm, with the constant "4" this test class is quite fragile towards extendability. Maybe repurpose the variable to only count "/testnode" topics?
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.
I would like to split off the moquette-thing anyway, it's not directly related. I merely pushed it to show that it's working. I'll check how this can be changed.
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.
Looks like the constant is still there. Is it easy to fix or should we merge it as-is?
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.
It's not so easy to fix. I think that the comment will help if someone changes the test and it fails again.
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.
OK let's then merge it! The comment is certainly helpful.
49f3d3a
to
132f5bb
Compare
They all succed in my local build now |
Signed-off-by: Jan N. Klug <[email protected]>
132f5bb
to
10422f2
Compare
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
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. These tests now also work on my local build.
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]> Signed-off-by: Maximilian Hess <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]> Signed-off-by: Tim Roberts <[email protected]>
Signed-off-by: Jan N. Klug <[email protected]>
Fixes #5905
I reworked the tests a little bit and now they succeed when using an external broker (just change the address of the publishConnection from
embeddedConnection.getHost()
to the IP/hostname of an external broker).What I can tell is that the subscription to 'homie/#' is obviously received by moquette but NO topics are send back to the client. When using my loccal mosquitto, this works. I'm out of ideas why this happens. Either paho is really sending the messages with QoS 0 (specs allow the broker to discard those, even if retained and moquette is known to do so), moquette is ignoring teh retained flag or not properly expanding the subscription wildcard.
Signed-off-by: Jan N. Klug [email protected]