From 41c55b75adbb5d6063f327741eb3b5bf90e49e89 Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Wed, 16 Sep 2026 14:10:55 +0100 Subject: [PATCH 1/3] In Android tests, disable Gradle daemon --- master/custom/factories.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/master/custom/factories.py b/master/custom/factories.py index 02920363..0d816fd4 100644 --- a/master/custom/factories.py +++ b/master/custom/factories.py @@ -1329,6 +1329,10 @@ class AndroidBuild(BaseBuild): its RAM size as described under "Testing". """ + # Make each run more independent + # (https://github.com/python/cpython/pull/155518#issuecomment-5259725142). + test_environ = {"GRADLE_OPTS": "-Dorg.gradle.daemon=false"} + def setup(self, **kwargs): android_py = ["python3", "Platforms/Android"] self.addSteps([ @@ -1375,6 +1379,7 @@ def setup(self, **kwargs): Test( command=android_py + ["test", "--managed", "maxVersion", "-v", "--slow-ci"], timeout=step_timeout(self.test_timeout), + env=self.test_environ, ), ]) From 89693b7ed57e3ee89d58306d9019393f1536cbbd Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Wed, 16 Sep 2026 14:14:34 +0100 Subject: [PATCH 2/3] Update worker setup instructions --- master/custom/factories.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/master/custom/factories.py b/master/custom/factories.py index 0d816fd4..70146de9 100644 --- a/master/custom/factories.py +++ b/master/custom/factories.py @@ -1320,13 +1320,11 @@ class AndroidBuild(BaseBuild): """Build Python for Android on a Linux or Mac machine, and test it using a Gradle-managed emulator. - To set up a worker, see cpython/Android/README.md, especially the following - sections: + To set up a worker, see cpython/Platforms/Android/README.md, especially the + following sections: * Install everything listed under "Prerequisites". * Do any OS-specific setup mentioned under "Testing". - * If the managed emulator appears to be running out of memory, increase - its RAM size as described under "Testing". """ # Make each run more independent From 3ebf4e8b54a1644b54350658fc68d155c90ae3ec Mon Sep 17 00:00:00 2001 From: Malcolm Smith Date: Wed, 16 Sep 2026 14:45:51 +0100 Subject: [PATCH 3/3] Add details to comment --- master/custom/factories.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/master/custom/factories.py b/master/custom/factories.py index 70146de9..8e56cbeb 100644 --- a/master/custom/factories.py +++ b/master/custom/factories.py @@ -1327,7 +1327,9 @@ class AndroidBuild(BaseBuild): * Do any OS-specific setup mentioned under "Testing". """ - # Make each run more independent + # When Gradle is interrupted, e.g. by a master shutdown, it sometimes gets + # into a state where it can't start emulators anymore. Work around this by + # not reusing Gradle daemons between runs # (https://github.com/python/cpython/pull/155518#issuecomment-5259725142). test_environ = {"GRADLE_OPTS": "-Dorg.gradle.daemon=false"}