Repository navigation
Port live/test-deadlock.cpp to pytest - #15427
Merged
Merged
Conversation
sysrsbuild-gh-agentic
left a comment
Collaborator
There was a problem hiding this comment.
π€ rs-agentic bot β automated review
Summary: Good port overall. A few issues noted below as inline comments.
Binyaminp
reviewed
Jul 16, 2026
| log.info("%d devices after reset", len(device_list)) | ||
|
|
||
| log.info("This caused deadlock") | ||
| for dev_idx in range(len(device_list)): |
Contributor
There was a problem hiding this comment.
why not use for d in device_list?
Collaborator
Author
There was a problem hiding this comment.
Kept the index loop to mirror the C++ original 1:1 (for dev_idx ... list[dev_idx]) per the minimal-diff migration convention. for d in device_list is functionally equivalent β happy to switch if you prefer.
Contributor
There was a problem hiding this comment.
Sure was just an enhancement recommendation
Binyaminp
approved these changes
Jul 16, 2026
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.
Overview: Port the C++ hw-reset deadlock regression test to pytest and drop the
.cpp.Tracked on [RSDSO-21706]
Why
unit-tests/live/test-deadlock.cppis one of the last live C++ exe tests. The deadlock it guards (RSDSO-19304 / GH #10482) lives in the native core β both C++ and Python funnel into the same C API (rs2_query_devices,rs2_hardware_reset,rs2_delete_device), so the pytest port keeps full regression coverage.Summary
unit-tests/live/hw-reset/pytest-deadlock.py: query devices,hardware_reset()all, sleep 6s, re-query, then assign + release each device handle β releasing the handle right away (del, mirroring the C++ scope-end destructor) is what triggered the original deadlock.device D400*βdevice_each("D400*"),donotrun:!nightlyβcontext("nightly"),timeout 12βpytest.mark.timeout(12)(deadlock is detected by timeout).unit-tests/live/test-deadlock.cpp; it is auto-discovered, no CMake change needed.Test plan
pytest live/hw-reset/pytest-deadlock.py -v --context nightlyβ 1 passedTest build 17279/
π€ Generated by AI