Skip to content

test: partition Windows apply coverage and rebalance hosted shards - #7917

Merged
lidge-jun merged 1 commit into
devfrom
fix/windows-hosted-test-partition
Oct 28, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/windows-hosted-test-partition

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Test-partition only, based on dev at be6b6b9556b0c075c350687ce515d0d024adfd69. Split the Windows CLI apply coverage into four sibling files and register all three new names in the layout domain shard and independent expected-layout fixture. The original 23 registration blocks expand to the same 31 cases; their bodies and parameter rows are byte-for-byte unchanged. Shared fixtures retain their existing cleanup/approval logic, with a separate root set and cleanup hook per importing file.
  • Rebalance through the existing duration table and least-loaded-shard algorithm. Regenerate Windows weights from 399 completed-file measurements in Windows 3/9 and Windows 5/9. Exclude the unfinished primary batches and attribution sweeps. Seed the four apply partitions at 2x measured local Windows wall time, explicitly marked as estimates in the table's source comment; replace these estimates with completed hosted timings in the next regular batch refresh.
  • Update the structure document's test references. Runtime source, workflow policy, 480s batch timeout, 30-minute job timeout, assertions, and test timeout constants are unchanged. No tests are skipped by this change.

The apply file had no Windows duration row and was assigned the 428ms median fallback. Its mixed batch and singleton attribution both exceeded 480s. Shard 5 had 303 completed files totaling 1,646.842s, against a whole-shard prediction of 1,108.478s, before cancellation in batch 56/56. Its heaviest completed files were:

File under tests/ Previous weight Hosted duration
server/management-provider-validation.test.ts 105.607s 191.841s
server/server-images.test.ts 47.342s 116.516s
server/server-combo-failover-e2e.test.ts 61.563s 87.540s
server/loopback-listener-integration.test.ts 73.964s 87.254s
codex-integration/issue-702-expired-replay-state.test.ts 38.712s 57.244s

The existing assignment code now predicts 1,273.795–1,273.873s per shard. The former shard-5 heavy work is redistributed through that algorithm. These predictions are not hosted completion evidence.

Verification

Run on Windows x64 with pinned Bun 1.4.4. Each test command used OCX_TEST_NO_QUEUE=1; only one Bun test process ran at a time.

  • bun install --frozen-lockfile — passed, no lockfile change.
  • Ran bun test --isolate --timeout 60000 <file> separately for each row below:
File under tests/codex-integration/ Pass/fail Local wall time Seeded Windows weight New shard
codex-cli-update-windows-apply.test.ts 7/0 63.68s 127.360s 9/9
codex-cli-update-windows-apply-install.test.ts 6/0 92.58s 185.160s 6/9
codex-cli-update-windows-apply-outcomes.test.ts 10/0 147.45s 294.900s 2/9
codex-cli-update-windows-apply-shared.test.ts 8/0 122.77s 245.540s 4/9

All 31 apply cases pass; every file is below the requested 200s local target. An initial split-validation run exposed an accidentally removed child-launch import in the shared partition; the import was restored before its successful run above, without changing any case body or assertion.

  • bun test --isolate --timeout 60000 tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/ci-shard-balance.test.ts tests/ci-workflows/macos-serial-lanes.test.ts tests/ci-workflows/ci-test-lane.test.ts tests/ci-workflows/ci-crash-disposition.test.ts — 45 pass, 64 existing platform skips, 0 fail. The POSIX fake-toolchain execution cases are already skipped on Windows; the duration-table parser, refresh, table-shape, layout, and ratchet checks executed.
  • bun run typecheck — passed, no type errors in 2,227 files.
  • bun run structure:check — passed.
  • bun run privacy:scan — passed.
  • Executed the unchanged runner's assignment and batch-construction code against the before/after tables in scratch: all 2,773 current test files assigned exactly once; all multi-file batches obey the existing 240s predicted budget and six-file limit. The four apply files land on distinct shards; the two estimated above 240s run alone. No production runner code changed.
  • Compared moved cases against the base and checked fixture logic separately. Concatenated case-block SHA-256: cf50c7534365729772f52bb7d5c87148edef29236a81c42c9a6e37a49351144a.
  • git diff --check — passed.

NOT RUN: full local suite (2,773 files is disproportionate on this shared Windows host; focused native behavior and the relevant metadata/harness checks were run), POSIX-only harness branches, and a new hosted Windows/macOS matrix. Hosted recovery remains to be established by a later normal batched dev run. No CI dispatch or rerun was requested; this PR requests the full Ubuntu PR subset with ci:full because the timing table is read as data. No merge is requested.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (structure test references updated; no user-facing runtime change).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults (fixture authority/cleanup logic preserved; no runtime, dependency, workflow-permission, or credential changes).

Summary by CodeRabbit

  • Tests
    • Expanded Windows Codex CLI update coverage for offline installation, cancellation, and no-op outcomes.
    • Added checks for partial or unexpected file changes, preservation of unrelated files, and recovery when completion cannot be recorded.
    • Added coverage for installer failures, process cleanup, and ownership retention when update state is uncertain.
    • Organized the Windows update tests into focused groups for installation, outcomes, and shared behavior.

@lidge-jun lidge-jun added the ci:full Run the four full Ubuntu test shards on this pull request label Oct 28, 2026
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 28, 2026 18:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-28T18:06:09.141363Z 1e89dc9 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between be6b6b9 and 1e89dc9.

Files ignored due to path filters: 1
  • scripts/ci/test-durations.windows.tsv is excluded by !**/*.tsv
Files selected for processing: 8
  • scripts/test-layout/layout-codex-collision.json
  • structure/codex-cli-update.md
  • tests/codex-integration/codex-cli-update-windows-apply-install.test.ts
  • tests/codex-integration/codex-cli-update-windows-apply-outcomes.test.ts
  • tests/codex-integration/codex-cli-update-windows-apply-shared.test.ts
  • tests/codex-integration/codex-cli-update-windows-apply.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/helpers/codex-cli-windows-apply-fixture.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Windows Codex CLI apply tests were moved into three focused test files. A shared helper now provides fixture creation, cleanup checks, and plan approval. The test-layout mappings and coverage description were updated to reflect the split.

Changes: Windows apply integration tests

Layer / File(s) Summary
Shared fixtures and test-suite split
tests/helpers/codex-cli-windows-apply-fixture.ts, tests/codex-integration/codex-cli-update-windows-apply.test.ts, scripts/test-layout/layout-codex-collision.json, tests/fixtures/test-layout-expected.json, structure/codex-cli-update.md
A shared helper now creates Windows x64 fixtures, approves plans, and checks cleanup. The existing test uses the helper, and the layout mappings and coverage description reflect the three added test files and their coverage.
Installation and Worker settlement
tests/codex-integration/codex-cli-update-windows-apply-install.test.ts
Tests cover Worker settlement, cancellation during the final process scan, offline npm installation, terminal installer results, npm command sequencing, and target readback.
Apply outcomes and persistence
tests/codex-integration/codex-cli-update-windows-apply-outcomes.test.ts
Tests cover process-state uncertainty, partial updates, unknown installer state, completion persistence retries, toolchain pinning, and planning with an unrelated directory under the shared prefix.
Shared-prefix behavior and native cleanup
tests/codex-integration/codex-cli-update-windows-apply-shared.test.ts
Tests cover successful updates and preservation, unexpected mutations, linked entries, native handle-close failures, and no-op installs.

Priority: Low

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

Change: Other

Possibly related PRs

  • lidge-jun/opencodex#7648: Adds the Windows apply transaction and ownership behavior exercised by these integration tests.
  • lidge-jun/opencodex#7614: Adds native child lifetime and terminal-result behavior covered by the Worker and cleanup tests.
  • lidge-jun/opencodex#7626: Adds the asynchronous job store and completion retry contracts exercised by the persistence tests.

Suggested reviewers: luvs01, ingwannu

Merge Risk: Minimal · up to 1e89d

This change reorganizes Windows CLI apply tests and their layout registration. It does not alter runtime behavior, and the supplied context shows no concrete merge-blocking risk. The author notes that hosted Windows/macOS shard timings are still unconfirmed.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test: partition Windows apply coverage and rebalance hosted shards" matches the main change. The PR splits Windows Codex CLI apply tests into separate files, registers the new files in the …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test: partition Windows apply coverage and rebalance hosted shards" matches the main change. The PR splits Windows Codex CLI apply tests into separate files, registers the new files in the layout shard and expected-layout fixture, and updates Windows duration weights used for shard rebalancing. The title is specific and concise. It omits the expected-layout and structure-doc updates, which are minor supporting changes. The title does not describe any change absent from the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 28, 2026
@lidge-jun
lidge-jun merged commit f5a5e5b into dev Oct 28, 2026
35 of 36 checks passed
@lidge-jun
lidge-jun deleted the fix/windows-hosted-test-partition branch October 28, 2026 18:17
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). ci:full Run the four full Ubuntu test shards on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant