Repository navigation
test: wait for descendant exit after streamed exec cleanup - #247
Conversation
Allow bounded PID polling after process-group cleanup on macOS, where the group probe can report EPERM after SIGKILL before a descendant finishes exiting. Keep the assertion bounded so surviving descendants still fail. Fixes #221 Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Completed a personal self-review at this head. No actionable findings: the timeout/cancel/repeated-cancel variants and the cleanup escalation/permission controls remain valid; six targeted checks passed. This is a review comment, not an independent maintainer approval.
rng1995
left a comment
There was a problem hiding this comment.
Final personal self-review: no actionable defect found. The bounded wait still rejects surviving descendants and permission errors, and final cleanup is preserved. Six targeted lifecycle/escalation/permission checks pass; the inline verification thread is resolved. I attempted the requested APPROVE review, but GitHub rejected it because this account authored the PR (HTTP 422: Can not approve your own pull request). This COMMENT review records the completed review; an independent maintainer must provide GitHub approval.
* test: wait for descendant exit after streamed exec cleanup Signed-off-by: Narendran Raghavan <[email protected]>
Summary
On macOS, successful SIGKILL cleanup can be followed by a brief interval in which the descendant PID still exists. The streamed-exec cleanup test currently requires immediate PID disappearance and can fail during that exit teardown.
Replace that immediate assertion with a monotonic, bounded five-second wait for
ProcessLookupError. A surviving descendant still fails the assertion, other signal errors still fail, and the existing final cleanup remains intact. This changes only the test: 10 inserted lines and 2 removed lines.Fixes #221.
Verification
I am familiar with the Contributing Guidelines
Added or updated focused tests
Updated documentation for user-visible changes — not applicable to this test-only fix
Ran
make lintRan
make test— complete CI suites pass; local-run limitations are recorded belowRan
make buildDid not add credentials, private datasets, or proprietary benchmark content
Native macOS stress run: 300 passed (100 each for timeout, cancellation, and repeated cancellation), four workers.
Controlled transient-PID reproduction: the original test fails when the first post-cleanup PID probe succeeds briefly; the updated test passes.
Survivor control: removing SIGKILL leaves a real descendant alive and the updated test fails at the five-second deadline.
The initial 300-case baseline had 291 passes and nine timeout-startup readiness failures under load; those failures did not reproduce the exit-teardown assertion and are not presented as evidence of that race.
Lint and source/wheel builds passed using Python 3.13 and locked all-extras dependencies.
Independent code review found no actionable issues.
Release Impact
CHANGELOG.mdFinal verification
All 17 CI checks pass on this PR's final head, including the full Python 3.12 and 3.13 suites, Windows Tier 2, native Windows fail-closed checks, macOS contract/progress checks, package builds, CodeQL, Gitleaks, dependency review, and DCO.
Local full-suite limitations
The local full-suite run was interrupted after 20 failed, 14,183 passed, 17 skipped. This is not reported as a local green suite. The isolated PATH accidentally excluded the trusted Docker executable, causing 15 Docker-related failures. Restoring
/usr/local/binin a 20-case control against unchanged Harbor/Tier 3 code produced 17 passes and three failures. The remaining failures reproduce in unchanged code: the streamed-timeout stderr assertion receives an additional Bash termination diagnostic, and two Bedrock configuration probes time out and reportunavailable. FIFO CLI startup timeouts from the loaded full run passed in that control.The Docker-missing control reproduced 19 of the cleanup branch's 20 local failures on unchanged code; the other FIFO case was intermittent. Additional Bedrock failures in the email branch are recorded below. No unrelated production changes were included. The complete CI checks above provide the full-suite verification for the final PR head.
Failures observed in the interrupted local full run
tests/test_harbor_local_mode.py::test_streamed_timeout_callback_matches_result_and_contains_descendantstests/test_harbor_secure_docker_environment.py::test_service_stop_and_sidecar_downloads_scrub_main_compose_environmenttests/test_harbor_secure_docker_environment.py::test_service_stop_uses_label_scoped_raw_docker_when_compose_model_requires_secret[main]tests/test_harbor_secure_docker_environment.py::test_service_stop_uses_label_scoped_raw_docker_when_compose_model_requires_secret[helper]tests/test_harbor_secure_docker_environment.py::test_service_stop_accepts_service_declared_by_trusted_compose_includetests/test_harbor_secure_docker_environment.py::test_windows_main_downloads_use_scrubbed_docker_env_and_validated_archivestests/test_harbor_secure_docker_environment.py::test_windows_transfer_removes_output_if_diagnostic_spool_creation_failstests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[11-0-True]tests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[0-11-True]tests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[6-5-True]tests/test_harbor_secure_docker_environment.py::test_windows_transfer_enforces_combined_temporary_disk_budget[6-4-False]tests/test_harbor_secure_docker_environment.py::test_windows_transfer_timeout_reaps_process_and_removes_partial_outputtests/test_harbor_secure_docker_environment.py::test_windows_transfer_idle_timeout_resets_while_output_progressestests/test_harbor_secure_docker_environment.py::test_windows_transfer_growing_output_exceeding_budget_reaps_processtests/test_harbor_secure_docker_environment.py::test_windows_transfer_total_timeout_reaps_continuously_progressing_processtests/test_harbor_secure_docker_environment.py::test_windows_transfer_rejects_process_completion_after_total_deadlinetests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_classifies_real_invalid_region_as_fataltests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_classifies_malformed_effective_proxy_as_fatal[http://127.0.0.1:banana]tests/tier3/test_workflow.py::test_fifo_dataset_is_rejected_without_blockingtests/tier3/test_workflow.py::test_legacy_fifo_is_rejected_without_blocking