Skip to content

[homie] Enable and fix tests - #21416

Merged
wborn merged 4 commits into
openhab:mainfrom
lsiepel:itest-homie
Aug 17, 2026
Merged

[homie] Enable and fix tests#21416
wborn merged 4 commits into
openhab:mainfrom
lsiepel:itest-homie

Conversation

@lsiepel

@lsiepel lsiepel commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

The failures were caused by timing and ordering assumptions in the tests, not in production code.

  • Re-enable retrieveOneAttribute, retrieveAttributes, and parseHomieTree.
  • Allow sufficient time for retained MQTT messages under load.
  • Wait for the channel-state callback instead of only detecting entry into a spied method.
  • Wait for the MQTT subscription to complete before publishing a non-retained message, preventing publication from winning the subscription race.
  • Wait for asynchronously delivered channel state before asserting it.
  • Reuse and properly clean up the test scheduler instead of leaking an executor.
  • Explicitly unsubscribe the temporary MQTT subscriber.
  • Keep the original internal Homie subscription timeouts to avoid unnecessary delays for optional attributes.

PR was created with the assistence of codex. Manually reviewed and adapted where needed.

Fixes: #12667
Refs: #12829
Refs: #12812

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 20:56
@lsiepel lsiepel added the test label Aug 16, 2026
@lsiepel
lsiepel requested a review from ccutrer as a code owner August 16, 2026 20:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR re-enables previously disabled Homie integration tests and improves their determinism by removing timing/ordering assumptions around MQTT subscription setup and asynchronous channel-state delivery.

Changes:

  • Re-enabled retrieveOneAttribute, retrieveAttributes, and parseHomieTree tests and increased timeouts for MQTT message arrival under CI load.
  • Adjusted assertions to wait on observable outcomes (channel-state callbacks / asynchronously delivered state) rather than relying on method-entry timing.
  • Improved test resource handling by reusing a shared scheduler and explicitly unsubscribing a temporary MQTT subscriber.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel

lsiepel commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

While working on these tests, codex found an issue in production code: #21417

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel
lsiepel requested a review from a team August 16, 2026 21:50

@wborn wborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This PR is initially reviewed with AI assistance.

The test synchronization and cleanup changes look good. The previously reported timing and subscription-ordering issues appear to be addressed, and no further functional issues were identified.

Signed-off-by: Leo Siepel <leosiepel@gmail.com>

@wborn wborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fixes!

@wborn
wborn merged commit a616fa3 into openhab:main Aug 17, 2026
2 checks passed
@wborn wborn added this to the 5.3 milestone Aug 17, 2026
@lsiepel
lsiepel deleted the itest-homie branch August 17, 2026 12:04
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.

[homie] HomieImplementationTest unstable

3 participants