Repository navigation
Tests: run local Robolectric suites in parallel - #28
Merged
Merged
Conversation
A full local unit run went from about 16 minutes to under 6. CI keeps one JVM, -Ptest.forks=N still overrides.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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=Nstill 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: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=1for 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):
TouchTargetTest.everyTabHasLargeEnoughTargetsLargeFontLayoutTest.noTextIsCutOnTheMainScreensBloodworkImportNavTest.importFromTheLogMenuLandsInJournalWithUndoLogDoseSiteTest.todaySheetStoresTheSuggestionAndReopensWithItLevelsLimitedScreenTest.limitedOverviewStatesItsLimitsLogAsPlannedTest.anUnchangedDoseSavesAsPlannedAndANoteEditKeepsItLevelsLockedScreenTest.lockedLevelsShowsAMessageInsteadOfChartsTodayScreenTest.devLogMenuOffersSymptomsAndBloodworkDoseEditSheetTest.todaysExtraOpensTheEditorAndDeletesWithUndoJournalSiteTest.editingADoseKeepsItsSiteBloodworkSheetLabTest.otherTestsAreShownAndEditedAsPrintedLoggedTodayTest.oneSectionByTimeWhoseRowsOpenTheirEditorsExtraDoseLastTakenTest.anExtraDoseStartsAtTheLastAmountJournalLogMenuTest.theLogMenuOpensTheExtraDosePickerBloodworkSheetEditTest.anEditedHemoglobinKeepsItsRangeEarlierTimeSheetTest.aNoteAt2330PickedJustAfterMidnightIsYesterdayCheckTimeTest.aChosenTimeIsWhatTheCheckRecordsAndNowSetsItBackLevelAdjustTest.raiseLowerAndResetJournalDeleteEntryTest.deleteEntryThenUndoCompoundPeakFieldTest.anUntouchedPeakSavesExactly