From 123fbc723c09488cc23c8e108356afa8b28075b6 Mon Sep 17 00:00:00 2001 From: MaxsTechReview Date: Sun, 18 Oct 2026 19:24:09 -0400 Subject: [PATCH] fix(ci): give unit tests a 2 GB heap (#1091) Robolectric keeps one sandbox per SDK level the tests ask for, and the suite now asks for seven (26, 28, 29, 31, 33, 34 and the default). They no longer fit in Gradle's default 512 MB test heap, so testReleaseUnitTest runs out of memory part way through (SteamHomeHeadsetTest, GlassesMenuCaptureTest) on main and on every open PR. --- app/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 4799d4fe4..b38e1b35a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -192,6 +192,8 @@ android { unitTests.returnDefaultValues = true unitTests.includeAndroidResources = true unitTests.all { + // Robolectric keeps a sandbox per SDK level the tests ask for; seven no longer fit in Gradle's default 512 MB. + maxHeapSize = '2g' def logTarget = providers.systemProperty('robolectric.logging').orNull if (logTarget != null) systemProperty 'robolectric.logging', logTarget }