Skip to content

Disable all hub ports after device discovery - #14880

Merged
Nir-Az merged 2 commits into
realsenseai:developmentfrom
Nir-Az:Nir-Az/fix/disable-ports-after-discovery
Mar 30, 2026
Merged

Nir-Az merged 2 commits into
realsenseai:developmentfrom
Nir-Az:Nir-Az/fix/disable-ports-after-discovery

Conversation

@Nir-Az

@Nir-Az Nir-Az commented Mar 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • After query() discovers devices, all hub ports are left enabled
  • A device on an unmapped port (e.g. loose cable on port 4) can appear mid-test and interfere — the test grabs the wrong device
  • Fix: disable all ports at the end of query() so tests start from a clean state
  • Each test's enable_only() then enables only the port it needs

Root cause

Build #111290 on rsdsk255: D585S safety tests failed because a D435 on USB2.1 (loose cable, unmapped port) appeared during the test. The test found the D435 instead of D585S → RuntimeError: Could not find requested sensor type!

Test plan

  • Verified cached enabled() state is consistent (all devices marked _removed after disable)
  • CI run on rsdsk255 with D585S safety tests

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 30, 2026 11:02

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 aims to ensure USB hub ports do not remain enabled after devices.query() completes device discovery, preventing “rogue” devices on unmapped/unused ports from appearing mid-test and interfering with device selection.

Changes:

  • Disable all hub ports at the end of devices.query() to reset the test environment to a clean baseline.
  • Wait for ports/devices to be fully disabled before proceeding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread unit-tests/py/rspy/devices.py Resolved
Comment thread unit-tests/py/rspy/devices.py Resolved
Comment thread unit-tests/py/rspy/devices.py Resolved
@Nir-Az
Nir-Az requested a review from AviaAv March 30, 2026 12:36

@AviaAv AviaAv 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.

Great improvement!

@Nir-Az
Nir-Az merged commit 9ae1720 into realsenseai:development Mar 30, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants