Skip to content

Tests: run local Robolectric suites in parallel - #28

Merged
ApolloF merged 2 commits into
mainfrom
ApolloF/Test-Suite
Oct 25, 2026
Merged

ApolloF merged 2 commits into
mainfrom
ApolloF/Test-Suite

Conversation

@ApolloF

@ApolloF ApolloF commented Oct 25, 2026

Copy link
Copy Markdown
Owner

The full local unit run was about 16 minutes on my PC because every Robolectric class gets its own JVM and they ran one after another. Locally it now uses one test JVM per four cores, at most four (six ran my 32 GB PC out of memory). CI still runs one JVM since that's where the 30 s waits got missed before, and -Ptest.forks=N still overrides both.

Also picks up the TodayWeekPagerTest fix from fix/week-pager-flake (wait for the day cross-fade before checking for Missed), which never made it to main.

Measured with :core:domain:test :core:data:testDebugUnitTest :app:testFossDebugUnitTest :app:testPlayDebugUnitTest --rerun, 803 tests, 16 threads / 32 GB:

Runs Failures Flakes Total time per run
Before (1 JVM) 3 0 0 964 s, 966 s, 965 s
After (4 JVMs) 3 0 0 337 s, 337 s, 335 s

No failures or flakes in any of the six runs (two earlier baseline runs were green too), so no test code changed besides the cherry-pick. I tried -XX:TieredStopAtLevel=1 for the test JVMs, no difference. Single tests get a bit slower under parallel load, the run as a whole gets about 3x faster.

Slowest 20 tests (mean of 3 runs and both flavours):

# Test Before (s) After (s)
1 TouchTargetTest.everyTabHasLargeEnoughTargets 7.8 9.6
2 LargeFontLayoutTest.noTextIsCutOnTheMainScreens 7.5 9.9
3 BloodworkImportNavTest.importFromTheLogMenuLandsInJournalWithUndo 6.2 8.2
4 LogDoseSiteTest.todaySheetStoresTheSuggestionAndReopensWithIt 6.2 8.4
5 LevelsLimitedScreenTest.limitedOverviewStatesItsLimits 6.2 8.1
6 LogAsPlannedTest.anUnchangedDoseSavesAsPlannedAndANoteEditKeepsIt 6.1 8.3
7 LevelsLockedScreenTest.lockedLevelsShowsAMessageInsteadOfCharts 6.0 7.8
8 TodayScreenTest.devLogMenuOffersSymptomsAndBloodwork 6.0 6.4
9 DoseEditSheetTest.todaysExtraOpensTheEditorAndDeletesWithUndo 6.0 8.0
10 JournalSiteTest.editingADoseKeepsItsSite 5.9 7.7
11 BloodworkSheetLabTest.otherTestsAreShownAndEditedAsPrinted 5.7 7.7
12 LoggedTodayTest.oneSectionByTimeWhoseRowsOpenTheirEditors 5.7 7.4
13 ExtraDoseLastTakenTest.anExtraDoseStartsAtTheLastAmount 5.7 7.5
14 JournalLogMenuTest.theLogMenuOpensTheExtraDosePicker 5.6 7.4
15 BloodworkSheetEditTest.anEditedHemoglobinKeepsItsRange 5.6 7.2
16 EarlierTimeSheetTest.aNoteAt2330PickedJustAfterMidnightIsYesterday 5.6 7.3
17 CheckTimeTest.aChosenTimeIsWhatTheCheckRecordsAndNowSetsItBack 5.6 7.6
18 LevelAdjustTest.raiseLowerAndReset 5.5 7.4
19 JournalDeleteEntryTest.deleteEntryThenUndo 5.5 7.2
20 CompoundPeakFieldTest.anUntouchedPeakSavesExactly 5.5 7.0

ApolloF and others added 2 commits October 25, 2026 02:06
A full local unit run went from about 16 minutes to under 6. CI keeps one
JVM, -Ptest.forks=N still overrides.
@ApolloF
ApolloF merged commit 9ab395f into main Oct 25, 2026
3 checks passed
@ApolloF
ApolloF deleted the ApolloF/Test-Suite branch October 25, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant