Repository navigation
test-device-hub waits for device reconnection - #14828
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the test-device-hub live unit test to reduce CI flakiness when a device is disconnected while it’s mid hardware-reset (powering down/up), by waiting for the device to reconnect before exiting the test.
Changes:
- Import
MAX_ENUMERATION_TIMEfromrspy.devices. - Add a post-test wait loop intended to wait for the device to be connected again before calling
test.print_results_and_exit().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Nir-Az
reviewed
Mar 18, 2026
|
|
||
| # Exiting the test will cause hub to disconnect port. We saw problems on CI when disconnecting like this when device is powering down/up so we wait for it to finish reset. | ||
| # (Unifi Hub stuck disconnecting port, D555 recovery OS -> domain set to 0) | ||
| hub.wait_for_device() |
Collaborator
There was a problem hiding this comment.
Lets make it a test to see the device gets connected again
+# -------- Wait for device to come back after hardware reset --------
56 +# The last reset left the device disconnected; wait for it to re-enumerate so the
57 +# test framework doesn't try to power-cycle the port while the device is mid-reset.
58 +test.start("device_hub: wait for device to reconnect after reset")
59 +try:
60 + reconnected_dev = hub.wait_for_device()
61 + test.check(reconnected_dev is not None, "Device did not reconnect after hardware_reset")
62 + test.check(hub.is_connected(reconnected_dev), "Reconnected device should be reported as connected")
63 +except:
64 + test.unexpected_exception()
65 +test.finish()
Collaborator
There was a problem hiding this comment.
Thanks for the fix, good idea :)
Nir-Az
approved these changes
Mar 18, 2026
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix CI issues when disconnecting a resetting device.