Skip to content

test(responses): make Windows shutdown spill fixtures deterministic - #3696

Merged
lidge-jun merged 3 commits into
devfrom
codex/a-00-windows-fixtures
Sep 5, 2026
Merged

test(responses): make Windows shutdown spill fixtures deterministic#3696
lidge-jun merged 3 commits into
devfrom
codex/a-00-windows-fixtures

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

Windows full-suite job 101339545421 exposed two shutdown-spill fixtures that depended on unmeasured filesystem timing. The stable-tail ordering case could enter an unmocked synchronous ACL fallback; the reserved-budget case controlled only the ACL clock and charged real disk time to its logical budget.

Make publication ordering explicit with path-specific gates, controlled timers, complete ACL mocks and cleanup. Use a shared logical spill/ACL clock for the reserve test while retaining its native drain timer, exact deadline-decrease checks, fallback proof and replay assertions. Production shutdown/ACL behavior and the separate deadline/watchdog tests are unchanged.

This independently verified foundation will be inserted below A's #3683#3686#3690#3692#3694 stack. The original Windows failure logs are preserved; it is not attributed to the SSE runtime fix.

Verification

  • Failed Windows evidence: https://github.com/lidge-jun/opencodex/actions/runs/33978547130/job/101339545421 (3048 pass,39 skip,2 failures,1 unhandled error).
  • Independent plan audit passed; git diff --check passed.
  • No local test suite, typecheck or build executed, per owner instruction.
  • Product candidate b2f24cada35ff998096cf7f3c83b95eef4ee55af: independent final fixture review PASS.
  • Hosted Windows/Bun1.4.0 proof passed:143 tests,0failures; controlled fallback/clock cases passed; broken drain and reset-deadline variants each failed the exact intended assertion; retained watchdog controls passed. Typecheck and source restoration passed.
  • Windows proof https://github.com/lidge-jun/opencodex/actions/runs/33981229052 executes a snapshot whose runtime/test/docs/dependency trees match the product candidate; its only extra files are the separately audited temporary verifier workflow/script.
  • Full exact-product-head CI https://github.com/lidge-jun/opencodex/actions/runs/33981268532 remains required before admin merge.
  • Any temporary hosted-Windows probe workflow lives only on a separate verification branch and will not be included in this PR.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Bug Fixes

    • Improved determinism for Windows shutdown and spill-handling verification.
    • Stabilized checks for drain completion, fallback budget usage, timing, and replay behavior.
    • Added safeguards to ensure asynchronous failures are captured and cleanup completes reliably.
  • Documentation

    • Added planning and review documentation covering Windows verification procedures, fixture behavior, audit steps, and validation criteria.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: b6cf24fb-efb0-41ef-b366-8cac00d2354e

📥 Commits

Reviewing files that changed from the base of the PR and between 9115b17 and b2f24ca.

📒 Files selected for processing (4)
  • devlog/_plan/260906_a_windows_fixture/000_plan.md
  • devlog/_plan/260906_a_windows_fixture/010_fixture_plan.md
  • devlog/_plan/260906_a_windows_fixture/011_review_resolution.md
  • tests/responses/responses-state.test.ts

📝 Walkthrough

Walkthrough

The change stabilizes two Windows spill shutdown tests. It replaces call-count and wall-clock synchronization with target-based gates, controlled clocks, fake timers, and explicit promise cleanup. Planning documents define the test-only verification and Windows proof procedures.

Changes

Windows spill fixture

Layer / File(s) Summary
Verification scope and evidence plan
devlog/_plan/260906_a_windows_fixture/000_plan.md, devlog/_plan/260906_a_windows_fixture/010_fixture_plan.md
Defines the test-only scope, verification roles, Windows evidence procedure, remote execution fallback, and landing criteria.
Stable-tail shutdown fixture
tests/responses/responses-state.test.ts, devlog/_plan/260906_a_windows_fixture/011_review_resolution.md
Gates ACL calls by spill temp path, freezes clocks, uses fake timers and native setImmediate, tracks drain and flush settlement, and joins promises during cleanup.
Reserved-budget shutdown fixture
tests/responses/responses-state.test.ts, devlog/_plan/260906_a_windows_fixture/010_fixture_plan.md
Records per-target ACL timing, controls the spill clock, verifies reserved-budget decrements, and confirms replay without releasing the asynchronous gate.

Estimated code review effort: 3 (Moderate) | ~25 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/a-00-windows-fixtures

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

github-actions Bot commented Sep 5, 2026

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 5, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 58 / 80

이 PR은 Windows full-suite에서 깨진 shutdown spill 픽스처 두 개를 디스크 타이밍에 의존하지 않게 고칩니다. A 런타임 스택(#3683#3686#3690#3692#3694) 아래에 깔 기초 층(0)입니다. 지금 devtests/responses/responses-state.test.ts는 ACL/drain 경로를 이미 다루지만, stable-tail 케이스는 unmocked sync ACL fallback에 들어갈 수 있고, reserved-budget 케이스는 ACL 시계만 통제하고 논리 budget에 실제 디스크 시간을 섞을 수 있습니다. 이 변경은 path-specific gate, controlled timer, 완전한 ACL mock/cleanup, 공유 logical spill/ACL clock으로 publication ordering과 deadline 감소를 결정적으로 만듭니다. 제품 shutdown/ACL 동작과 별도 watchdog 테스트는 건드리지 않는다고 합니다.

검증은 실패한 Windows job 증거, 호스티드 Windows/Bun 부분 증명, exact-product-head CI 요구를 본문에 적어 두었습니다. owner 지시로 로컬 suite는 안 돌렸습니다. #3683이 이 브랜치를 base로 쓰도록 스택이 잡혀 있어, A 트레인 랜딩 전에 먼저 넣는 순서가 맞습니다. types/config 분할과 무관합니다.

플래키 Windows verifier가 있으면 위층 SSE/WS/recovery PR의 CI가 전부 노이즈가 됩니다. 픽스처만 고치는 작은 표면이라 리뷰 부담도 낮습니다. draft이고 full exact-head CI가 아직 게이트입니다.

경로 tests/responses/responses-state.test.ts stable-tail - temp path gate + fake timers + stub-swap 기록으로 mid-drain publication 순서를 고정합니다. 실디스크 latency가 drain timer를 울리지 않게 합니다.

경로 같은 파일 reserved-budget - spill/ACL에 공유 logical clock, native drain timer는 유지, deadline 감소·fallback·replay assert 유지.

경로 plan 260906_a_windows_fixture - 근거/리뷰 해상도 문서입니다. 머지 블로커는 아니고 제품 코드 변경은 테스트 파일입니다.

경로 임시 verifier workflow - 별도 검증 브랜치에만 두고 이 PR에 넣지 말라고 본문이 못 박습니다. 맞습니다.

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

  • A 스택 머지 전에 이 PR을 반드시 먼저 dev에 넣을지, #3683 base로만 두고 한 번에 올릴지
  • Windows full-suite 초록을 이 PR 단독 게이트로 요구할지

너의 추천
A 스택 기초로 exact-head Windows CI 초록·draft 해제 후 먼저 머지를 추천합니다. 그다음 #3683 base를 dev로 옮기거나 ff로 쌓으세요.

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

@lidge-jun
lidge-jun marked this pull request as ready for review September 5, 2026 18:12
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 18:12
@lidge-jun

Copy link
Copy Markdown
Owner Author

Owner-authorized admin merge after independent fixture/security review and exact-head verification.

At b2f24ca every functional producer in full cross-platform run 33981268532 passed: all Linux shards, both macOS shards, the unsharded macOS control, all six Windows shards, type/privacy gates and platform smoke jobs. Only the deterministic aggregation job remained queued at the final check; its success/skipped allowlist was checked directly. No test execution or failure was bypassed.

Actual hosted Windows causal verification also passed in run 33981229052 on an identical runtime/test tree: 143 passing tests, bounded fallback/clock controls, exact negative-control assertions, retained watchdogs, source restoration and typecheck. The temporary verifier workflow is not part of this merge.

@lidge-jun
lidge-jun merged commit 35ddb12 into dev Sep 5, 2026
52 of 54 checks passed
@lidge-jun
lidge-jun deleted the codex/a-00-windows-fixtures branch September 5, 2026 18:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 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-09-05T18:13:50.611840Z b2f24ca Draft marked ready
ℹ️ 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.

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.

1 participant