Skip to content

Comments

Fix discovery tests to accommodate changes in discovery registration#19473

Merged
jlaur merged 1 commit intoopenhab:mainfrom
Nadahar:fix-discovery-tests
Oct 12, 2025
Merged

Fix discovery tests to accommodate changes in discovery registration#19473
jlaur merged 1 commit intoopenhab:mainfrom
Nadahar:fix-discovery-tests

Conversation

@Nadahar
Copy link
Contributor

@Nadahar Nadahar commented Oct 12, 2025

After the changes to Core in openhab/openhab-core#5032, some add-on tests failed because the timing of the registration process changed.

Some were taken care of in #19230, some will be fixed by #19471, some are yet to be fixed and were disabled and some seem to have slipped by unnoticed.

This addresses those that slipped by.

Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 12, 2025

The changes to MQTT HomeAssistant don't seem to be directly related to openhab/openhab-core#5032, and as far as I can understand, the test must have been failing also in the past, if assertions were enabled.

I replaced assert with assertTrue() for the following reason: The tests actually have a system for waiting until the discovery results are in, using CountDownLatch, which should make it immune to the recent timing changes. But, for some reason, the waiting was done using assert, which is disabled by default and must be explicitly enabled when the JVM is launched. I don't know if this was intentional or not, but I see it as much more desirable that this waiting mechanism is enabled the whole time.

@jlaur FYI

@Nadahar
Copy link
Contributor Author

Nadahar commented Oct 12, 2025

@lsiepel I think this one should be good too.

@jlaur jlaur added the test label Oct 12, 2025
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

@jlaur jlaur merged commit 650cd92 into openhab:main Oct 12, 2025
3 checks passed
@jlaur jlaur added this to the 5.1 milestone Oct 12, 2025
@Nadahar Nadahar deleted the fix-discovery-tests branch October 12, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants