Skip to content

test: wait for descendant exit after streamed exec cleanup - #247

Merged
rng1995 merged 1 commit into
mainfrom
naren/fix-macos-cancellation-test-race
Oct 28, 2026
Merged

rng1995 merged 1 commit into
mainfrom
naren/fix-macos-cancellation-test-race

Conversation

@rng1995

@rng1995 rng1995 commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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 lint

  • Ran make test — complete CI suites pass; local-run limitations are recorded below

  • Ran make build

  • Did 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

  • No user-visible release note needed
  • Updated CHANGELOG.md

Final 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/bin in 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 report unavailable. 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_descendants
  • tests/test_harbor_secure_docker_environment.py::test_service_stop_and_sidecar_downloads_scrub_main_compose_environment
  • tests/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_include
  • tests/test_harbor_secure_docker_environment.py::test_windows_main_downloads_use_scrubbed_docker_env_and_validated_archives
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_removes_output_if_diagnostic_spool_creation_fails
  • tests/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_output
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_idle_timeout_resets_while_output_progresses
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_growing_output_exceeding_budget_reaps_process
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_total_timeout_reaps_continuously_progressing_process
  • tests/test_harbor_secure_docker_environment.py::test_windows_transfer_rejects_process_completion_after_total_deadline
  • tests/test_harbor_runtime_preflight.py::test_bedrock_model_probe_classifies_real_invalid_region_as_fatal
  • tests/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_blocking
  • tests/tier3/test_workflow.py::test_legacy_fifo_is_rejected_without_blocking

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
rng1995 marked this pull request as ready for review October 28, 2026 22:09

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/test_harbor_local_mode.py Resolved

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rng1995
rng1995 merged commit 9bd9c8e into main Oct 28, 2026
17 checks passed
@rng1995
rng1995 deleted the naren/fix-macos-cancellation-test-race branch October 28, 2026 22:59
@rng1995 rng1995 mentioned this pull request Oct 30, 2026
15 of 20 tasks
chrisknvidia pushed a commit that referenced this pull request Oct 30, 2026
* test: wait for descendant exit after streamed exec cleanup

Signed-off-by: Narendran Raghavan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: macOS cancellation cleanup test races with process exit

1 participant