Repository navigation
pytest-sync: drop redundant per-iteration hardware_reset (RSDSO-21449) - #14990
Merged
Nir-Az merged 1 commit intoApr 30, 2026
Merged
Conversation
…sleeps (RSDSO-21449)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR mitigates a reported nightly segfault in the pytest-sync live metadata test by removing a redundant per-iteration hardware_reset() that can race with the hub-recycle infrastructure, and by adding small stabilization delays around pipeline reconfiguration.
Changes:
- Remove
device.hardware_reset()and device re-enumeration from each configuration iteration intest_synchronized_frames. - Add an initial
time.sleep(1)after fixture setup to allow post hub-recycle settling before the firstpipeline.start(). - Add
time.sleep(2)between configurations to allow settling afterpipeline.stop().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
unit-tests/live/metadata/pytest-sync.py::test_synchronized_framessegfaulted in nightly LRS_linux_compile_lib_ci #11175, killing the whole pytest session. The Python main thread was sleeping intime.sleep(5)(line 161) immediately afterdevice.hardware_reset()(line 160); the actual fault is in a librealsense backend thread.The pytest hub-recycle in
module_device_setup(unit-tests/conftest.py:435-466) had just power-cycled the port and re-enumerated the D455 milliseconds earlier — callinghardware_reset()on a freshly enumerated USB device triggers a race in the SDK backend.Changes
device.hardware_reset()from the loop intest_synchronized_frames— it was inherited verbatim from legacytest-sync.py, which predated the hub-recycle infrastructure. With pytest's--hub-reset, iter 0 already gets a freshly recycled device, andpipeline.start/stopisolates per-config state for iters 1-5.time.sleep(1)before the loop to let the device settle after the hub recycle (matches the convention inpytest-stress.py:75andpytest-sanity.py:48, both of which pass).time.sleep(2)between iterations to let hardware settle afterpipeline.stop()before the next configuration starts.time.sleep(5)afterpipeline.start()inrun_test()unchanged.Reference
Test plan
pytest-sync.pyno longer segfaults under--context nightly --hub-reset.Nightly build passing - https://rsjenkins.realsenseai.com/job/LRS_libci_pipeline/15315/