Skip to content

test: isolate Windows runtime discovery and reservation fixtures - #5484

Closed
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/4956-windows-readiness-isolation
Closed

luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/4956-windows-readiness-isolation

Conversation

@luvs01

@luvs01 luvs01 commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Addresses two Windows fixture exposures discussed in [Bug]: spawned Bun child processes stop producing output and never exit, on both macOS and Windows CI legs #4956. Readiness probes isolate PATH and HOME but previously inherited LOCALAPPDATA, allowing full discovery to launch a developer's installed Codex runtime. The fixture now owns that directory too; a real executable sentinel proves that removing the isolation would launch the external candidate while ordinary discovery remains enabled.
  • The two-process reset-credit reservation case now replaces only disposable children's Windows principal/ACL helper commands through existing test seams. Those host helpers can each wait 30 seconds, exceeding the fixture's 20-second child deadline. Real SQLite contention, atomic journal publication, and all reservation assertions remain intact. Timeout diagnostics include the marker protocol's phases; empty stdout alone does not mean a child failed to start.
  • Production code and timeouts are unchanged. This is a scoped correction, not a claim that all macOS silent hangs in [Bug]: spawned Bun child processes stop producing output and never exit, on both macOS and Windows CI legs #4956 share this cause. The issue remains open for the separately captured Bun synchronous-process wait.

Verification

  • Pinned Bun 1.4.0: bun run test:changed selected both changed files and passed 39 tests / 250 assertions, zero failures.
  • bun run typecheck, bun run privacy:scan, and git diff --check passed.
  • Negative control: temporarily disabling reservation ID reuse in the isolated checkout made the real two-process case fail with two IDs instead of one. Original production bytes were restored and verified by SHA-256; the full 19-case file then passed.
  • Readiness sentinel negative control exercises an explicit inherited install root and observes its --version invocation. With fixture isolation, that invocation is absent and lower-priority full discovery still runs.
  • Hosted Windows verification (diagnostic run 35682566884, job 106602459110, contributor fork Actions) checked out exact head 5f9d1046a804e863cc0835340dc6e1781c0bf186 with Bun 1.4.0 and passed all 39 tests in 34.13 seconds, zero failures. No full-suite Windows result is claimed; this PR remains draft pending required checks and review.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. Test-only behavior; no user-facing contract changed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. Production hardening is unchanged; maintainer review of the fixture isolation is pending.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 22, 2026
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 55 / 80

이 PR은 #4956의 Windows 쪽 테스트 픽스처를 고칩니다. 제품 코드와 타임아웃은 그대로 두고, 테스트만 손봅니다. 첫 번째는 cli-connect-readiness입니다. Windows는 PATH·HOME만 막아도 LOCALAPPDATA 아래 깔린 Codex를 찾을 수 있어서, 개발자 PC에 있는 진짜 런타임이 readiness 탐침에 끼어들 수 있었습니다. 이제 픽스처가 LOCALAPPDATA도 자기 임시 폴더로 바꿉니다. 그리고 Bun 실행 파일을 codex.exe처럼 복사해 둔 “가짜 설치본”으로, 격리를 끄면 그 파일이 --version으로 실행되고, 격리를 켜면 안 불리면서도 낮은 우선순위 full discovery는 여전히 돌아가는지 확인합니다. 두 번째는 codex-reset-credit-auto-redeem의 두 프로세스 예약 테스트입니다. Windows에서 principal/ACL 도우미가 각각 최대 30초까지 기다릴 수 있는데, 자식 마감은 20초라 테스트가 엉뚱한 이유로 타임아웃날 수 있습니다. 그래서 일회용 자식 안에서만 기존 테스트용 seam으로 그 도우미를 가짜로 바꾸고, SQLite 경쟁·저널 원자 기록·예약 ID 재사용 같은 진짜 검증은 남깁니다. 타임아웃 메시지에는 ready/tick/consume/result 마커 단계도 넣어서, stdout이 비어 있다고 자식이 안 뜬 걸로 오해하지 않게 했습니다. base는 dev이고 draft이며, 작성자도 호스트 Windows 전체 결과나 #4956의 Bun 동기 대기 문제는 이 PR로 닫지 않는다고 적어 두었습니다.

라인 - 새 readiness 격리는 test.skipIf(process.platform !== "win32")라 Linux/macOS CI에서는 센티널 검증이 안 돕니다. LOCALAPPDATA를 픽스처 env에 넣는 코드는 전 플랫폼 ladder에 들어가지만, “외부 설치본이 실제로 안 불리는지”는 Windows에서만 증명됩니다.
라인 - readiness 테스트가 부모 프로세스의 process.env.LOCALAPPDATA를 잠깐 바꿉니다. finally에서 되돌리지만, 같은 worker에서 테스트가 겹치거나 비정상 종료하면 다른 케이스가 오염될 여지는 남습니다.
라인 - 센티널 감지가 file === sentinel 문자열 일치입니다. Windows에서 경로 대소문자·정규화가 어긋나면 “시도는 했는데 기록 못 함”이 되어, 격리 실패를 놓칠 수 있습니다.
라인 - reset-credit 두 프로세스 케이스는 Windows에서 실제 icacls/principal 조회를 더 이상 타지 않습니다. 예약 경쟁 증명에는 맞지만, 이 테스트만으로는 그 도우미 경로 회귀는 못 잡습니다.
라인 - PR이 draft이고, 본문대로 호스트 Windows CI·전체 스위트 결과는 아직 주장하지 않습니다. 로컬 Bun 1.4.0 test:changed 근거만으로는 CI Windows shard 안정화까지 “검증됨”으로 보기 어렵습니다.

메인테이너의 판단이 필요한 지점

  • #4956은 열린 채로 두고, 이 draft를 Windows 픽스처만의 부분 수정으로 먼저 Ready/머지할지.
  • 두 프로세스 예약 테스트에서 ACL/principal을 계속 stub해도 되는지, 아니면 별도 Windows 전용 케이스로 실도우미를 남길지.
  • Ready 전에 호스트 Windows run 한 번을 필수 증거로 볼지.

너의 추천

이 댓글은 grok-bot이 작성했습니다

@luvs01
luvs01 requested a review from Ingwannu September 22, 2026 03:19
lidge-jun added a commit that referenced this pull request Sep 22, 2026
…#5509)

* chore(dev): retire automatic pre-push validation (#5500)

Carry #5500 and align both draft enforcement prompts with scoped validation. Clarify that inherited Git override isolation belongs to the fixture harness.

Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>

* ci: root macOS discovery and diagnose owned process waits (#5483)

Carry the rooted sharded suite and read-only stall observer without changing control-lane batching, suite budgets, or failure propagation.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>

* test: isolate Windows runtime discovery and reservation fixtures (#5484)

Carry #5484 while avoiding the unnecessary parent LOCALAPPDATA mutation. Preserve real SQLite contention, atomic publication, reservation assertions, and existing deadlines.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>

* fix(ci): bound translation email scanning (#5454)

Carry the at-sign-anchored sanitizer scan, explanatory rationale, and long-token regression without changing mention-defusing semantics.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>

* fix(ci): redact diagnostic paths and align localized command lists

Capture and redact sample output before bounded emission, retain diagnostic child ownership and regression fixtures, and add the missing test:changed command to six locale inventories. Local runtime validation remains NOT RUN by owner instruction.

* fix(ci): preserve legacy checklist bodies with durable re-attestation

Require author clear-and-retick saves bound to real head/base and persisted server-time checkpoints. Preserve pending state across events, invalidate stale evidence, and refresh live PR and saved proof before readiness. Keep body writes out of migration handling and cover mutation failures and sequential races.

Local runtime validation: NOT RUN by owner instruction. Independent static review passed; hosted verification and explicit maintainer security review remain pending.

* fix(ci): require saved attestation evidence before readiness promotion

The pre-ready readback compared the saved gate comment with the run's
expected state, but the gate mutated the listed comment object in place,
so a readback that shared it observed this run's own write. Replace the
object instead and require the saved state to be a finalized attestation
of the live head, base and body before any ready side effect.

A wording-only save that keeps its ticks now gets a specific action, so
the rejected shortcut is acknowledged in the gate comment instead of
being skipped as a byte-identical update.

Record the readback as a reviewed read, and move the self-contained
exhaustive-deps suppression block byte for byte into a sibling file to
keep ci-workflows.test.ts under its size cap.

Local runtime validation: NOT RUN by owner instruction; hosted CI verifies.

---------

Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com>
Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
@lidge-jun

Copy link
Copy Markdown
Owner

Thanks @luvs01. The Windows runtime discovery and reservation fixture isolation from this PR landed on dev through #5509 (squash commit 798c07c), with a Co-authored-by trailer crediting you. Closing as superseded by that bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants