From 9f39cee9d36a400f0a310914eb309d2eeb07b720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 22 Oct 2025 01:01:01 +0300 Subject: [PATCH 1/3] When starting a test run, delete all old Emscripten files in the temp directory to help avoid runaway temp file leaks filling a CI system temp directory. --- test/runner.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/runner.py b/test/runner.py index e793992b184aa..ab26cf4c050df 100755 --- a/test/runner.py +++ b/test/runner.py @@ -525,6 +525,17 @@ def configure(): common.configure_test_browser() +def cleanup_emscripten_temp(): + """Deletes all files and directories under Emscripten + that look like they might have been created by Emscripten.""" + for entry in os.listdir(shared.TEMP_DIR): + if entry.startswith(('emtest_', 'emscripten_')): + try: + utils.delete_dir(os.path.join(shared.TEMP_DIR, entry)) + except Exception as e: + pass + + def main(): options = parse_args() @@ -573,6 +584,7 @@ def set_env(name, option_value): check_js_engines() # Remove any old test files before starting the run + cleanup_emscripten_temp() utils.delete_file(common.flaky_tests_log_filename) utils.delete_file(common.browser_spawn_lock_filename) utils.delete_file(f'{common.browser_spawn_lock_filename}_counter') From d5c6e1a57c85d835923d6a07c0f44bf37c755742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 22 Oct 2025 01:41:53 +0300 Subject: [PATCH 2/3] ruff --- test/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runner.py b/test/runner.py index ab26cf4c050df..e0a5944360f58 100755 --- a/test/runner.py +++ b/test/runner.py @@ -532,7 +532,7 @@ def cleanup_emscripten_temp(): if entry.startswith(('emtest_', 'emscripten_')): try: utils.delete_dir(os.path.join(shared.TEMP_DIR, entry)) - except Exception as e: + except Exception: pass From 5bd72bdb806f8d9c71ca16736fa13e5760691581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 22 Oct 2025 03:18:58 +0300 Subject: [PATCH 3/3] Use isdir() --- test/runner.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/runner.py b/test/runner.py index e0a5944360f58..e302ade646a3f 100755 --- a/test/runner.py +++ b/test/runner.py @@ -530,8 +530,10 @@ def cleanup_emscripten_temp(): that look like they might have been created by Emscripten.""" for entry in os.listdir(shared.TEMP_DIR): if entry.startswith(('emtest_', 'emscripten_')): + entry = os.path.join(shared.TEMP_DIR, entry) try: - utils.delete_dir(os.path.join(shared.TEMP_DIR, entry)) + if os.path.isdir(entry): + utils.delete_dir(entry) except Exception: pass