Fixes for OutputExecutor banner detection issues - fixes #1115 - #1116
Fixes for OutputExecutor banner detection issues - fixes #1115#1116fizyk wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthrough
ChangesOutputExecutor output handling
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant OutputExecutor
participant OutputWaiter
participant ReadableDescriptor
OutputExecutor->>OutputWaiter: wait for banner output
OutputWaiter->>ReadableDescriptor: drain available output
ReadableDescriptor-->>OutputWaiter: output or closed stream
OutputWaiter->>OutputExecutor: return on banner, quiet stream, or timeout
Possibly related issues
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/executors/test_output_executor.py`:
- Around line 59-73: Update test_executor_dont_start_when_process_exits so its
elapsed-time assertion is bounded by the configured timeout value of 2 seconds
plus a small scheduling allowance, rather than a fixed ten-second limit. Keep
the TimeoutExpired expectation and executor.running() assertion unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2a562d94-fd90-4f69-bd44-768d882fad0b
📒 Files selected for processing (5)
mirakuru/output.pynewsfragments/1115.bugfixnewsfragments/1115.bugfix.1newsfragments/1115.bugfix.2tests/executors/test_output_executor.py
| def test_executor_dont_start_when_process_exits() -> None: | ||
| """Executor should time out when the process ends without the banner. | ||
|
|
||
| Once the process is gone its output is at end of file, which descriptors | ||
| keep reporting as readable - that must not keep the executor spinning | ||
| instead of honouring its timeout. | ||
| """ | ||
| command = 'bash -c "echo foo"' | ||
| executor = OutputExecutor(command, "foobar", timeout=2) | ||
| start = time.time() | ||
| with pytest.raises(TimeoutExpired): | ||
| executor.start() | ||
|
|
||
| assert time.time() - start < 10 | ||
| assert executor.running() is False |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Make the elapsed-time assertion enforce the configured timeout.
Line 72 accepts a delay of almost ten seconds when timeout=2. A regression that delays startup failure far beyond the configured timeout can pass this test. Assert against the timeout plus a small scheduling allowance.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/executors/test_output_executor.py` around lines 59 - 73, Update
test_executor_dont_start_when_process_exits so its elapsed-time assertion is
bounded by the configured timeout value of 2 seconds plus a small scheduling
allowance, rather than a fixed ten-second limit. Keep the TimeoutExpired
expectation and executor.running() assertion unchanged.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary by CodeRabbit
Bug Fixes
Tests