fix(ci): isolate storage policy tests from Linux shards - #1204
Conversation
📝 WalkthroughWalkthroughThe CI workflow moves storage-policy tests out of Linux shards into a dedicated Ubuntu job. The CI gate requires this job. A workflow test validates the isolation, execution settings, test coverage, and dependency wiring. ChangesStorage-policy CI isolation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/zz-ci-storage-policy-isolation.test.ts`:
- Around line 43-46: Update the assertions around dedicatedFiles and storageRun
to extract the test-path arguments from the command, then compare that extracted
set exactly with dedicatedFiles rather than only checking containment. Preserve
the existing assertion that storageRun excludes “--shard”.
🪄 Autofix
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 48df0050-fc1b-4d48-8310-6602f506dfe7
📒 Files selected for processing (2)
.github/workflows/ci.ymltests/zz-ci-storage-policy-isolation.test.ts
| for (const file of dedicatedFiles) { | ||
| expect(storageRun).toContain(`./${file}`); | ||
| } | ||
| expect(storageRun).not.toContain("--shard"); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert the exact storage-policy file set.
Lines 43-45 only prove that the five expected files are present. The test still passes if the command adds another test file or a broad tests argument. That change breaks the exact quarantine contract without failing this regression test.
Extract the test-path arguments and compare them with dedicatedFiles.
Proposed fix
- for (const file of dedicatedFiles) {
- expect(storageRun).toContain(`./${file}`);
- }
+ const testArgs = storageRun
+ .split(/\s+/)
+ .filter(argument => argument === "tests" || argument.startsWith("./tests/"));
+ expect(testArgs).toEqual(dedicatedFiles.map(file => `./${file}`));
expect(storageRun).not.toContain("--shard");📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for (const file of dedicatedFiles) { | |
| expect(storageRun).toContain(`./${file}`); | |
| } | |
| expect(storageRun).not.toContain("--shard"); | |
| const testArgs = storageRun | |
| .split(/\s+/) | |
| .filter(argument => argument === "tests" || argument.startsWith("./tests/")); | |
| expect(testArgs).toEqual(dedicatedFiles.map(file => `./${file}`)); | |
| expect(storageRun).not.toContain("--shard"); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/zz-ci-storage-policy-isolation.test.ts` around lines 43 - 46, Update
the assertions around dedicatedFiles and storageRun to extract the test-path
arguments from the command, then compare that extracted set exactly with
dedicatedFiles rather than only checking containment. Preserve the existing
assertion that storageRun excludes “--shard”.
Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Summary
api-storage-policy*suites from the general four-way Linuxbun test --isolateshardscicheck depend on the dedicated storage-policy job, so its failure can never be hidden behind a green aggregate checkWhy
Linux shard 3 has repeatedly hit Bun 1.3.14 runtime corruption around the storage-policy boundary:
After that unhandled runtime error Bun reports follow-on lifecycle errors such as
Cannot call beforeEach() after the test run has completed, continues running in a corrupted state, and can then stop making progress until GitHub Actions kills the 15-minute shard.The same
devsuite can pass on another run, so this is not a deterministic product-test failure. It is an isolate/runtime race whose blast radius is currently an entire ~150-file shard.The storage-policy tests are already structured as a coherent Bun-isolation family: the Worker-spawning cases are split one-per-file, with the non-Worker GET/PUT companion beside them. This PR keeps that family together in a clean process instead of allowing a Bun runtime failure there to poison unrelated tests.
Behavior after this change
General Linux shards run:
The dedicated job separately runs these exact files without sharding:
tests/api-storage-policy-already-running.test.tstests/api-storage-policy-mutation-busy.test.tstests/api-storage-policy-put-race.test.tstests/api-storage-policy-run.test.tstests/api-storage-policy.test.tsIf Bun still wedges on that harness, the failure is isolated to a 5-minute job instead of consuming and corrupting a general 15-minute shard.
Scope
This is intentionally separate from #1179. That PR hardens Worker reclaim and bounds the later Claude probe child process; this PR contains the remaining nondeterministic Bun isolate failure at the CI topology level rather than adding more sleeps or increasing timeouts.
Validation
devbefore PR creationSummary by CodeRabbit