Repository navigation
fix: stop CLI logic capture after interrupted waits - #316
YashAnand69 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to Interrupting a logic analyzer capture from the CLI now attempts to stop the analyzer instead of leaving it running. Successful captures behave as before. No actionable merge risk remains. Security Architecture Review
Pre-merge checks |
|
|
Sorry @YashAnand69, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 23 hours and 52 minutes by commenting |
Reviewer's GuideThe CLI now reliably sends STOP_LA when a started logic-analyzer capture is interrupted or the acquisition wait raises, while preserving normal results and failure semantics. New transport-controlled tests cover interruption cleanup, success ordering, initiation failures, and cleanup-error context. Sequence diagram for interrupted logic analyzer capture cleanupsequenceDiagram
participant CLI
participant LogicAnalyzer
participant Transport
CLI->>LogicAnalyzer: capture(channels, block=False)
LogicAnalyzer->>Transport: START_LA
Transport-->>LogicAnalyzer: acknowledgment
CLI->>CLI: time.sleep(duration)
alt wait completes
CLI->>LogicAnalyzer: stop()
else wait interrupted or raises
CLI->>LogicAnalyzer: stop()
end
LogicAnalyzer->>Transport: STOP_LA
Transport-->>LogicAnalyzer: acknowledgment
CLI->>LogicAnalyzer: fetch_data()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Interrupting
pslab collect logic_analyzerduring its acquisition wait skipsSTOP_LA, leaving capture running after the command exits.Put the wait in
try/finallyso the existing stop command is attempted on interruption as well as success. Failed capture initiation still propagates without an additional stop, and successful channel names, timestamps and stop-before-fetch order are unchanged.Validation: twelve interruption regressions fail on unchanged main; six success/error controls pass. The fixed branch passes all 18 new tests plus 33 existing CLI, Pico SCPI and MQ135 cases (51 total), independently rerun after full diff review. Tests use the real LogicAnalyzer capture/stop methods with a controlled transport and check STOP_LA plus acknowledgment. Configured Black, Flake8, Bandit and pydocstyle, wheel/sdist and Sphinx builds pass; seven existing docs warnings remain. Scoped CLI coverage does not decrease (73.656% to 73.797%). Combining this patch with the updated #315 passes 61 tests.
No physical PSLab or full device integration suite was run. A failed stop command still propagates its transport error with the original interruption as context; cleanup requires a working connection. This differs from #314's ultrasonic trigger-output cleanup and #267's CLI transport migration. Current issue comments and open patches were checked for overlap. Developed and tested with Codex assistance.