Don't preload container files under Robolectric - #1964
jeremybernstein wants to merge 1 commit into
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthrough
ChangesRobolectric preload handling
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
Robolectric boots a fresh app with a fresh filesDir for every test, so on the modern flavor the background preload re-downloaded every container archive per test: gigabytes per suite run, enough to fill a CI runner's disk. code that needs a container file still fetches it on demand.
3bbe3f6 to
307ac9c
Compare
Description
PluviaApp.onCreatestartspreloadAllContainerFilesin the background. Robolectric boots a fresh app with a freshfilesDirfor every test, so on the modern flavor every Robolectric test re-downloads every container archive. Measured locally: two test classes (30 tests) downloaded 31 archives, at least 1.2 GB, in 53 s. Across the suite this fills the CI runner's disk ("No space left on device" duringRun unit tests (modern)) and saturates the network, and the modern test step timing out at 30 minutes on several recent PRs is consistent with it.Fix: skip the preload when
Build.FINGERPRINT == "robolectric". The preload is only a warm-up; code that needs a container file already fetches it on demand throughensureContainerFileAvailable, so tests that need one still get it, whether run alone or in a full sweep. With the fix the same two classes download nothing in the background and run in 21 s. A full modern-flavor sweep (1,236 tests) finishes in 8.5 minutes with exactly one container download: the oneContainerFilesDownloaderTestmakes on purpose.Recording
n/a (infrastructure)
Type of Change
Checklist
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.CONTRIBUTING.md.Summary by cubic
Skips the background container preload under Robolectric so test runs no longer re-download every container archive per test. Robolectric boots each test with a fresh
filesDir, so the old warm-up downloaded gigabytes per run and filled CI runner disks; tests that need a container file still fetch it on demand.Written for commit 307ac9c. Summary will update on new commits.
Summary by CodeRabbit