Repository navigation
Description
Problem Description
devops test run --changed prints a Python traceback when pytest runs longer than the subprocess timeout. run_test_cmd (src/devops_cli/commands/test_cmd.py:195) calls run_subprocess(cmd, cwd=repo_root, check=False), and subprocess.TimeoutExpired goes up through core/process.py with no handler. The output is about 480 lines: the traceback and the full pytest argument list of 421 test modules. The command does not say which limit stopped it or what to do.
Reproduction Steps
- On a host with a high load (load average 42 on 16 cores), change about 50 files on a branch, so that the narrowed run selects 421 test modules.
- Run
uv run devops test run --changed. - After 1800 s, the command stops.
Expected vs Actual Behavior
Expected: one error line that names the timeout (1800 s) and the setting or option that changes it, and exit 1, as other devops commands do for a DevOpsCLIError.
Actual: a Rich traceback that ends in TimeoutExpired: Command '['uv', 'run', 'pytest', ...]' timed out after 1800.0 seconds, with every test path of the argument list.
Environment Diagnostics
devops-cli at origin/main 9208717 plus the branch of #4835, Python 3.14, devcontainer.
Logs, Traces, or Terminal Output
Frames: core/cli.py:221 traced_fn -> commands/test_cmd.py:195 run_test_cmd -> core/process.py:918 run_subprocess -> core/process.py:655 run -> subprocess.py:1268 _check_timeout.
Related: #4683 and #4775 give devops ci rows their own time limits; they do not cover devops test run.
Alternatives check of 2026-11-15: none.
Tool: none found.
Proposed design
Problem statement
The devops test run --changed command prints a Rich traceback when pytest runs longer than the subprocess timeout. The traceback ends in TimeoutExpired and shows the full 421-module argument list, but it does not name the 1800-second limit or the option that changes it. The command must report one DevOpsCLIError line and exit 1.
Acceptance criteria
Requirement: Timeout error line
The devops test run command SHALL report a pytest subprocess timeout as one DevOpsCLIError line and exit with status 1.
Scenario: Changed run exceeds timeout
- WHEN The pytest subprocess exceeds the test-run timeout.
- THEN The command prints one error line that names the timeout in seconds and the
--timeoutoption, prints no traceback, and exits 1.
Requirement: Configurable timeout
The devops test run command SHALL use the --timeout option, default 1800 seconds, as the pytest subprocess timeout.
Scenario: Custom timeout value
- WHEN A user runs
devops test run --timeout 60. - THEN The command passes 60 seconds as the timeout to
run_subprocess.
Requirement: Effective timeout in message
The timeout error line SHALL state the effective timeout value that stopped the run.
Scenario: Non-default timeout in error
- WHEN The test run uses a timeout of 60 seconds and the subprocess exceeds it.
- THEN The error line states 60 seconds, not 1800 seconds.
Requirement: Non-timeout behavior
The command SHALL keep the existing output and exit status for a pytest failure that is not a timeout.
Scenario: Pytest fails before timeout
- WHEN The pytest subprocess exits with a non-zero status before the timeout.
- THEN The command reports the pytest result as before and prints no timeout error.
Existing Tool Considered
The 2026-11-15 alternatives check found no open, maintained tool that converts subprocess.TimeoutExpired into this project's DevOpsCLIError or that knows the --timeout option. The fix is local code in run_test_cmd. The written cost is about 1,500 tokens to build, keep and fix that code, and less than one hour.
Key questions
- Where does
subprocess.TimeoutExpiredescaperun_test_cmd?: It escapes from therun_subprocesscall atsrc/devops_cli/commands/test_cmd.py:195;src/devops_cli/core/process.py:918callsrunatsrc/devops_cli/core/process.py:655, which letssubprocess.TimeoutExpiredpropagate. [sources: src/devops_cli/commands/test_cmd.py:195, src/devops_cli/core/process.py:918, src/devops_cli/core/process.py:655] - How should the command report a timeout?: Catch
subprocess.TimeoutExpiredinrun_test_cmdand raiseDevOpsCLIErrorwith the effective timeout and the--timeoutoption. The CLI exit seam prints one error line and exits with the error code. (best practice) [sources: ARCHITECTURE.md:173, src/devops_cli/exceptions/base.py:19, src/devops_cli/commands/test_cmd.py:195]- Rejected: Let the traceback propagate. It prints 480 lines and does not name the limit or the option.
- Rejected: Catch and print directly. It bypasses the one exit seam and the error exit code.
- Chosen: Raise DevOpsCLIError. The exit seam prints one line, escapes markup, and exits 1 with no traceback.
- Which option changes the test-run timeout?: Add or use the
--timeoutoption ofdevops test run, default 1800 seconds, and pass its value torun_subprocess. (best practice) [sources: src/devops_cli/commands/test_cmd.py:139, src/devops_cli/commands/test_cmd.py:195, src/devops_cli/core/process.py:918]- Chosen: Use a
--timeoutoption. It is explicit, testable, and the error can name it. - Rejected: Use a fixed 1800-second default. A user cannot change the limit for this command.
- Rejected: Use a config setting with no CLI option. No source names such a setting, and the error cannot name a concrete control.
- Chosen: Use a
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.test, and .github/labels.yml declares no scope/test label. Add the label to the file to give the scope to this item.The command still stops at the timeout; the defect is only the 480-line traceback instead of a one-line error.A 480-line traceback with 421 test paths is hard to read; one clean line with the timeout value and the option to change it is a clear UX gain.Catch TimeoutExpired at test_cmd.py:195 and raise DevOpsCLIError with the timeout value and the setting name.Both handle subprocess timeouts in core/process.py, but #4775 adds per-row time limits for devops ci while the candidate fixes the error message for devops test run.devops-cli-service commentedon Nov 15, 2026
Alternatives check: none
Reason: The searches turned up no open tool or library that converts a
subprocess.TimeoutExpiredfrom a pytest run into a one-line CLI error, and none that knows this project's own setting name for the test-run timeout. The intake reply itself puts the fix atcommands/test_cmd.py:195: catch the exception and raiseDevOpsCLIErrorwith the timeout value and the setting, which only the project's own code can name.Tool: none found
Lacks:
subprocess.TimeoutExpiredfromrun_subprocessinto the project'sDevOpsCLIErrorwith exit 1run_test_cmdcall site in the project's own codeSearches run:
Checked on 2026-11-15. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 16, 2026
Status set to Ready at fccb781 (see proposed design in issue body).
devops-cli-service commentedon Nov 18, 2026
Released in v0.177.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.177.0
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 16:28 UTC