Repository navigation
Stop leaking video consumption threads in Jetson producer-selection tests - #3116
Conversation
…ests Three tests in test_video_source.py start a VideoSource on a MagicMock producer and never terminate it. The background thread keeps reading, unpacks MagicMock().retrieve() (0 items) and logs "ValueError: not enough values to unpack (expected 2, got 0)". The exception is caught in the thread, so CI stays green but the log shows a scary traceback. Mock retrieve() to return (False, None) so the thread exits cleanly, and terminate the source at the end of each test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
👋 Thanks for the pull request! Here is how automated Claude review works here, so you spend credits (and reviewer time) wisely. 🚦 This PR is marked Ready for review, so automated Claude review will run — and every pass spends real credits. Warning 💸 The Claude reviewer bills in credits, not vibesAutomated review spins up a real agent that reads real code and spends real credits on every pass. It is glad to help — but it is not a rubber duck, a linter you poke in a loop, or a substitute for reading the contributing guide. Treat it like an expensive senior reviewer whose time you booked, and show up prepared. Draft when unsure, Ready when you mean it:
However you get there, arrive prepared:
Reviews are not free. A draft costs nothing to review; a Ready PR is a promise that it is worth reviewing.
|
|
🤖 Claude review started at commit New commits are not auto-reviewed. Add the |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (1)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
What
Three tests in
tests/inference/unit_tests/core/interfaces/camera/test_video_source.pystart aVideoSourceon a mocked producer and never stop it:test_video_source_selects_gstreamer_producer_for_rtsps_on_jetsontest_video_source_selects_gstreamer_for_rtsps_when_running_on_jetson_alias_resolvestest_video_source_keeps_cv2_producer_for_plain_rtsp_on_jetsonWhy
The consumption thread outlives the test. It calls
video.retrieve()on aMagicMock, and unpacking aMagicMockyields 0 items. The thread catches the exception and logs:CI stays green, but the traceback shows up in unit-test logs (seen in #3114, job log). This is a test-only problem: real producers always return a 2-tuple.
Fix
retrieve()to return(False, None), so the thread exits cleanly.tear_down_source(source)helper at the end of each test.Verification (local, Python 3.12)
test_video_source.py: 66 passed.pytest -s -k jetson: the traceback appears 3 times before the fix and 0 times after it.🤖 Generated with Claude Code
Summary by CodeRabbit