Repository navigation
Stop the Regression Container by Name and Refuse Arguments First - #1308
Conversation
A docker CLI holding a TTY passes no SIGTERM to its container, so the harness signal trap now stops the running container with docker kill by name, then waits for the CLI. The EXIT trap's rollback no longer runs under a container still processing the test dataset. The trap falls back to signalling the CLI where no container run is active or the kill fails. regression-test.sh validates the tag, corpus, plugin, and coverage arguments ahead of the nonroot and users lookups, so a bad argument is refused with 64 on any host. integration-test.sh refuses a dash-prefixed argument in any position, and an existing WORKDIR before the tool lookup. Closes #1305 Closes #1306 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
PR Summary by QodoStop the regression container before rollback and validate arguments early
AI Description
Merge Risk
|
|
A recorded local strict-review pass covers head |
Code Review by Qodo
1. Interrupting one run stops another
|
There was a problem hiding this comment.
🟡 Changes recommended
The script still performs environment-variable checks before validating positional arguments, so invalid input can trigger unrelated work and violate the required refusal-before-work contract.
1 open issue
What changed in this PR
This PR hardens the RegressionTests shell harnesses by stopping named Docker containers during terminal interrupts and expanding early argument-validation coverage. The regression script's positional validation still occurs after required-environment checks.
Changes:
- Adds container-aware signal handling with a fallback to terminating the Docker CLI.
- Reorders selected regression and integration argument checks before host-dependent operations.
- Expands signal and refusal tests, including TTY and failed-container-stop scenarios.
| File | Description |
|---|---|
| RegressionTests/tests/test_shell_scripts.py | Adds tests for integration argument rejection and work-directory refusal ordering. |
| RegressionTests/tests/test_regression_harness.py | Adds coverage for TTY signal handling, container-stop fallback, and plugin validation ordering. |
| RegressionTests/tests/script_helpers.py | Allows signal tests to provide custom standard input descriptors, including pseudo-terminals. |
| RegressionTests/regression-test.sh | Adds named-container signal cleanup and reorders selected positional validation, while required-environment checks still precede the positional preflight. |
| RegressionTests/integration-test.sh | Rejects dash-prefixed arguments in any position and checks existing work directories earlier. |
Review effort: Lite
|
@coderabbitai review |
Action performed
|
|
@qodo-free-for-open-source-projects please dismiss finding 1, 'Interrupting one run stops another' (RegressionTests/regression-test.sh:103-105). Disproven. The harness is single-run by design. Every run restores the one fixed dataset snapshot ( |
I couldn't dismiss Your rationale is clear: the harness assumes one run at a time, so a concurrent run corrupts the dataset before an interrupt matters. If you want me to dismiss it, please confirm that this is the finding you mean and I'll proceed. Note that only the PR author can dismiss findings. |

Why
regression-test.shadds-ittodocker runwhen its standard input is a terminal, which is the usualsudo env ... regression-test.shrun. In TTY mode the docker CLI passes no signals to its container. So a SIGTERM sent to the harness never reached PlexCleaner, and theEXITtrap'szfs rollbackcould run while the container was still processing the test dataset (#1305).The harness and
integration-test.shalso refused some arguments only after host lookups or a tool lookup, so a bad argument could exit 1 with an unrelated error instead of 64 (#1306).What
regression-test.sh: aRunContainerwrapper records the container name for the length of eachdocker run. TheINT/TERMtrap sends SIGTERM to that container withdocker kill, then waits on the CLI, which exits once the container stops. Where no container run is active, ordocker killfails, the trap signals the child as before.regression-test.sh: the tag, corpus, plugin, andREGRESSION_COVERAGE_TOOLchecks run ahead of thenonroot/userslookups.integration-test.sh: a dash-prefixed argument is refused in any position, and an existing WORKDIR is refused before the dotnet-coverage lookup.docker killfails. New refusal tests cover each reordered check. Each new test fails againstdevelop's scripts.The
commentslabel covers the trap's one new comment line, plus two existing comments the validation move carries along.Verification
python3 -m unittest discover -s testsinRegressionTests/: 141 tests OK. ruff, mypy, shellcheck, and shfmt are clean.docker killfails bothkill_works=Falsesubtests.Closes #1305
Closes #1306
🤖 Generated with Claude Code
Summary by CodeRabbit