Stop gradle daemon on the internal bot
We sometimes see massive memory usage after many runs, this stops the daemon after each run
Change-Id: I00044f8b81121c6aec11973e4ecb892ef8ff0c72
diff --git a/tools/internal_test.py b/tools/internal_test.py
index 5209b5b..a09ab68 100755
--- a/tools/internal_test.py
+++ b/tools/internal_test.py
@@ -29,6 +29,7 @@
# Delete TESTING_COMPLETE
# Exit based on status
+import gradle
import optparse
import os
import subprocess
@@ -306,6 +307,8 @@
# Bot does not have a lot of memory.
env['R8_GRADLE_CORES_PER_FORK'] = '16'
failed = any([execute(cmd, archive, env) for cmd in TEST_COMMANDS])
+ # Gradle daemon occasionally leaks memory, stop it.
+ gradle.RunGradle('--stop')
archive_status(1 if failed else 0)
return failed