test: bound subprocess execution time #127
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"4f8b47d59f06aab73df047b4628742d0f821e155","has_any_findings":true,"has_unresolved_findings":true,"status":"failed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ❌ Failed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ❌ Failed <relative-time datetime="2026-11-19T00:01:29.807241Z">2026-11-19T00:01:29.807241Z</relative-time><br/>We couldn’t complete this review. Comment @codex review to try again. | 4f8b47d | PR opened |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.
timeout=120.tests/forks_cli_test.py.<!-- coderabbit-ai-generated:v1 -->
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
<a href="https://app.coderabbit.ai/change-stack/btclib-org/seed-scan/pull/127?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>
<!-- review_stack_entry_end -->
<!-- This is an auto-generated comment: rate limited by coderabbit.ai -->
[!WARNING]
## Review limit reached
> This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.
> Next included review available in 44 minutes.
> Check out review usage here.
> <details>
<summary><strong>View limit details</strong></summary>
<dl>
<dd>
<br>
> Limit details: You’ve used the included review currently available.
> Learn how review limits work.
> Review configuration:
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
<dl>
<dd>
<br>
> - Source mode: Auto
- Repository: [btclib-org/seed-scan](<https://github.com/btclib-org/seed-scan>)
- Branch: [main](<https://github.com/btclib-org/seed-scan/tree/main>)
- File: [.coderabbit.yaml](<https://github.com/btclib-org/seed-scan/blob/700317960f1ccd6f2f015bc97d374a7242c63672/.coderabbit.yaml>)
- Commit: [7003179](<https://github.com/btclib-org/seed-scan/commit/700317960f1ccd6f2f015bc97d374a7242c63672>)
- Layers: Repository YAML
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID: 5bdd40d1-3ef6-4c96-8b3e-b94a10c3b2af> </dd>
</dl>
</details>
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
<dl>
<dd>
<br>
> Reviewing files that changed from the base of the PR and between 4f8b47d59f06aab73df047b4628742d0f821e155 and c289b4b2148028900844b8650e261e26e5c42c09.
> </dd>
</dl>
</details>
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 3</strong></summary>
<dl>
<dd>
<br>
> tests/cli_test.py tests/imports_test.py tests/scan_cli_test.py> </dd>
</dl>
</details>
> </dd>
</dl>
</details>
<!-- end of auto-generated comment: rate limited by coderabbit.ai -->
<!-- recent_review_status_start -->
No actionable comments were generated in the recent review.
<!-- recent_review_status_end -->
<!-- walkthrough_start -->
<details>
<summary><strong>Summary</strong></summary>
<dl>
<dd>
<br>
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Tests
Added 120-second limits to subprocess checks, causing tests to fail if child processes exceed the time limit rather than hang until the overall job timeout.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Seven subprocess calls in CLI, import, and scan tests now use a 120-second timeout. Comments explain that the bound prevents a hanging child process from running until the job timeout.
Changes: Test subprocess timeouts
|Layer / File(s)|Summary|
|:---|:---|
|Add timeout bounds to test subprocesses <br> tests/cli_test.py, tests/imports_test.py, tests/scan_cli_test.py|Seven subprocess calls now set a 120-second timeout. Comments explain the timeout bound.|
<!-- change_assessment_start -->
Estimated code review effort: 2 (Simple) | ~5 minutes
<!-- change_assessment_commit:"4f8b47d59f06aab73df047b4628742d0f821e155" -->
<!-- change_assessment_priority:{"version":1,"urgency":"p3","manual":false} -->
Change: Other
<!-- change_assessment_end -->
Suggested reviewers: fametrano
</dd>
</dl>
</details>
<!-- walkthrough_end -->
<details>
<summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · previous review <code>4f8b4</code></summary>
<dl>
<dd>
<br>
<!-- final_review_risk_start -->
<!-- final_review_risk_label
Merge Risk: ⚪ Minimal · up to 4f8b4
-->
<!-- final_review_risk_coverage:{"sourceCommitId":"4f8b47d59f06aab73df047b4628742d0f821e155","coveredCommitId":"4f8b47d59f06aab73df047b4628742d0f821e155","kind":"reviewed"} -->
This change only bounds how long test subprocesses can run, so a hung child fails its test instead of waiting for the job timeout. It has no production impact and is ready to merge.
<!-- final_review_risk_end -->
</dd>
</dl>
</details>
<!-- pre_merge_checks_walkthrough_start -->
<details>
<summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary>
<dl>
<dd>
<br>
| Check name | Status | Explanation |
| :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Title check | !Passed | The title "test: bound subprocess execution time" matches the main change: adding timeout=120 to seven test subprocess calls. It uses a conventional type prefix and is specific. The title check refere… |
| Description check | !Passed | The description states that seven test subprocess calls get a 120-second timeout, lists the affected files and call counts, mentions the explanatory comments, the verification steps, and closes issue … |
| Linked Issues check | !Passed | Issue #36 requires that every subprocess.run in tests/ that starts a child interpreter passes timeout=120 with a explanatory comment. The whole-PR diff (merge base bf42f430 to head 4f8b47d5) add… |
| Out of Scope Changes check | !Passed | All changed hunks are timeout=120 arguments and explanatory comments on the seven subprocess calls named in issue #36. No subprocess command, argument, or expected-output assertion changed. No unrel… |
<details>
<summary><strong>Full details: Title check</strong></summary>
<dl>
<dd>
<br>
Explanation
The title "test: bound subprocess execution time" matches the main change: adding timeout=120 to seven test subprocess calls. It uses a conventional type prefix and is specific. The title check references a org standard link (Section 11 'What a pull request says it is'), but the link content was not available to verify the exact formatting rules, so the title is judged on relevance and clarity.
</dd>
</dl>
</details>
<details>
<summary><strong>Full details: Description check</strong></summary>
<dl>
<dd>
<br>
Explanation
The description states that seven test subprocess calls get a 120-second timeout, lists the affected files and call counts, mentions the explanatory comments, the verification steps, and closes issue #36. It matches the changeset and the linked objectives.
</dd>
</dl>
</details>
<details>
<summary><strong>Full details: Linked Issues check</strong></summary>
<dl>
<dd>
<br>
Explanation
Issue #36 requires that every subprocess.run in tests/ that starts a child interpreter passes timeout=120 with a explanatory comment. The whole-PR diff (merge base bf42f430 to head 4f8b47d5) adds timeout=120 and a comment to all seven named calls: four in tests/cli_test.py (the probe calls near former lines 471, 505, 569, 585), two in tests/imports_test.py (_loaded_after_importing and _installed_after_importing), and one in tests/scan_cli_test.py (test_scan_loads_no_identify). The comment names the bound used by tests/conftest_test.py, which matches the pattern the issue requests. The child script at tests/cli_test.py:583 is unchanged, as the issue requires. No other coding requirement appears in the issue. The PR does not reference this implementation's test results directly, but the diff establishes the required behavior. The diff does not show a test run; this assessment rests on the source diff.
</dd>
</dl>
</details>
<details>
<summary><strong>Full details: Out of Scope Changes check</strong></summary>
<dl>
<dd>
<br>
Explanation
All changed hunks are timeout=120 arguments and explanatory comments on the seven subprocess calls named in issue #36. No subprocess command, argument, or expected-output assertion changed. No unrelated files are modified. The diff touches only tests/cli_test.py, tests/imports_test.py, and tests/scan_cli_test.py.
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary><strong>Finishing Touches</strong></summary>
<dl>
<dd>
<br>
<details open>
<summary><strong>Generate unit tests (beta)</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
<!-- finishing_touch_suggestion:fix_ci -->
<details open>
<summary><strong>Fix failing CI checks</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
</dd>
</dl>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- autopilot:start -->
<!-- autopilot:end -->
<!-- tips_start -->
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.
<details>
<summary><strong>Share</strong></summary>
<dl>
<dd>
<br>
</dd>
</dl>
</details>
<!-- tips_end -->
<!-- recent_review_start -->
<h6>
<details>
<summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary>
<dl>
<dd>
<br>
<!-- review_info_content -->
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
<dl>
<dd>
<br>
10009c42-069f-43be-9869-b941e0702114</dd>
</dl>
</details>
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
<dl>
<dd>
<br>
Reviewing files that changed from the base of the PR and between bf42f43086d8739d74417e165703ff06d19d066f and 4f8b47d59f06aab73df047b4628742d0f821e155.
</dd>
</dl>
</details>
<details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 3</strong></summary>
<dl>
<dd>
<br>
tests/cli_test.py
tests/imports_test.py
tests/scan_cli_test.py
</dd>
</dl>
</details>
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
</dd>
</dl>
</details>
</h6>
<!-- recent_review_end -->
Thank you, @Aaqibhafeezkhan: this does what #36 asks, and the one thing holding it is the sign-off.
The Sign-off check is required, and your commit 4f8b47d has no Signed-off-by: trailer. The trailer certifies the Developer Certificate of Origin, so it has to come from you; we cannot add it for you. On your branch, with the address the check names as your git user.email, run:
git rebase --signoff bf42f43086d8739d74417e165703ff06d19d066f
git push --force-with-lease
Under the organization's CONTRIBUTING.md, a pull request whose commits still lack the trailer seven days after it was asked for is closed: for this one, on 2026-11-26. It can come back after that, as the same section says.
What is right: the seven calls #36 lists are the seven you changed, each with timeout=120 and the comment tests/forks_cli_test.py already gives its child, and the child's own script in tests/cli_test.py is left alone, as the issue asks. I found nothing else to change. Once the trailer is in, I will run the review and the gates on the new head.
@fametrano
Thanks for pointing this out. I've added the required Signed-off-by trailer to the latest commit using my GitHub-associated email address
Please let me know if anything else is needed. Thanks for confirming that the implementation itself meets the requirements.
Thank you, @Aaqibhafeezkhan: the trailer is in, and nothing else needed changing. This now waits only on the maintainer's approval.
Review record, on c289b4b2148028900844b8650e261e26e5c42c09:
CLEARED c289b4b. It walked every subprocess.run under tests/ at the base and at the merge with main (6814c15): all nine calls that start a child interpreter now pass timeout=120, the child's own script in tests/cli_test.py is unchanged, and no other launcher of a child interpreter exists in tests/. It also showed with a standalone probe that a child hanging past the timeout raises TimeoutExpired and is killed, which is what the new comment says. One finding, not blocking: the title carries no (closes #36), so the squash subject adds it at landing.uv sync --locked, the hooks on the three files, and tests/cli_test.py with tests/imports_test.py (94 passed) exit 0. tests/scan_cli_test.py cannot run there: its loopback binds are refused by the sandbox (28 tests, each a PermissionError in bind), though the one test this pull request changes in it passed. The full suite rests on CI, green on c289b4b with coverage at 100%.CLEARED stands in for it.main at 6814c15.Approves c289b4b, on the maintainer's decision in the session. It relies on the dedicated reviewer's CLEARED c289b4b (Codex unavailable: out of credits since 2026-11-18 20:33 UTC); no rebase. The review bot is absent (fork), Codex's GitHub review failed on its usage limit, and CodeRabbit's check passed with no finding. Every check passed or was skipped on c289b4b. Not checked locally: tests/scan_cli_test.py and the full suite, which the sandbox cannot run (loopback binds); CI ran them.
Landed as 01bf226, thank you, @Aaqibhafeezkhan. A child interpreter that hangs in the tests now fails the test that started it within two minutes, instead of holding the whole job until its 30-minute limit, so a hang shows up under the name of the test that caused it.
Nothing was added on top: the pull request did exactly what #36 asked, and followed the comment the tree already uses, which made it quick to review. The one thing the squash changed is its subject, which now ends (closes #36): a pull request that closes an issue names it in its title, so the issue's closing shows up in main's history too.
If you would like another, #61 (evm.Node accepts any transport and timeout) is open and labelled good first issue, and close in shape to #128.
fametrano
Aaqibhafeezkhan
What this changes
Adds a 120-second timeout to the seven test subprocess calls that start child interpreters.
tests/cli_test.py.tests/imports_test.py.tests/scan_cli_test.py.Closes #36.
How it was verified
Updated all seven subprocess calls identified by the issue to use
timeout=120, following the existing pattern intests/forks_cli_test.py.The child-process script explicitly excluded by the issue remains unchanged.
Checks
uv run pre-commit run --all-filesis clean (ruff, mypy strict, markdownlint, the copyright notice,uv.lock)uv run pytestpassesAnything the reviewer should know
No changes to subprocess commands, arguments, or expected output.