Skip to content

Stabilize doctor process cancellation test - #396

Merged
lynnswap merged 2 commits into
mainfrom
codex/fix-doctor-cancellation-test
Oct 3, 2026
Merged

lynnswap merged 2 commits into
mainfrom
codex/fix-doctor-cancellation-test

Conversation

@lynnswap

@lynnswap lynnswap commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Purpose

Prevent timing-dependent failures in cancellingLiveRunnerTerminatesTheDoctorProcess, which failed in the ReviewMonitor CI job. The PID file can exist before its contents are written, and assertion reporting can change errno before the next assertion reads it. The CI log does not identify the failing assertion, so the exact failure remains unconfirmed.

Changes

  • Install the signal handler and write the PID before publishing readiness. Stop at the existing deadline if readiness never arrives.
  • Use exec /bin/sleep to keep the same PID without consuming a CPU core while waiting for cancellation.
  • Stop and join the watchdog when it is cancelled, and fail the test if it had to send SIGKILL.
  • Capture the kill result and errno immediately, before running assertions.

Testing

  • Final changes: all 15 CodexCommandUpdateCheckerTests tests passed on Xcode 27 / macOS arm64, including 17 executions with parameterized cases.
  • git diff --check passed.
  • Local Codex reviews reported no findings.

Command used for the final test run:

xcodebuild test \
  -project Tools/ReviewMonitor/CodexReviewMonitor.xcodeproj \
  -scheme CodexReviewMonitor \
  -destination 'platform=macOS,arch=arm64' \
  -disableAutomaticPackageResolution \
  -onlyUsePackageVersionsFromResolvedFile \
  -skipMacroValidation \
  -only-testing:CodexReviewMonitorCITests/CodexCommandUpdateCheckerTests \
  CODE_SIGNING_ALLOWED=NO \
  CODE_SIGNING_REQUIRED=NO

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T10:37:35.800510Z 202399b PR opened
🔒 Security Review ✅ Completed 2026-10-03T10:38:45.740312Z 202399b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lynnswap
lynnswap merged commit 8a7cc3c into main Oct 3, 2026
5 checks passed
@lynnswap
lynnswap deleted the codex/fix-doctor-cancellation-test branch October 3, 2026 11:50
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.

1 participant