Skip to content

Commit c81dbdd

Browse files
authored
Have test harness delete all old Emscripten files in the temp directory (emscripten-core#25614)
When starting a test run, delete all old Emscripten files in the temp directory to help avoid runaway temp file leaks filling up a CI system hard drive. Do it before starting a run, so that developers can still access test files in debug logs.
1 parent 0ba015a commit c81dbdd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/runner.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,19 @@ def configure():
525525
common.configure_test_browser()
526526

527527

528+
def cleanup_emscripten_temp():
529+
"""Deletes all files and directories under Emscripten
530+
that look like they might have been created by Emscripten."""
531+
for entry in os.listdir(shared.TEMP_DIR):
532+
if entry.startswith(('emtest_', 'emscripten_')):
533+
entry = os.path.join(shared.TEMP_DIR, entry)
534+
try:
535+
if os.path.isdir(entry):
536+
utils.delete_dir(entry)
537+
except Exception:
538+
pass
539+
540+
528541
def main():
529542
options = parse_args()
530543

@@ -573,6 +586,7 @@ def set_env(name, option_value):
573586
check_js_engines()
574587

575588
# Remove any old test files before starting the run
589+
cleanup_emscripten_temp()
576590
utils.delete_file(common.flaky_tests_log_filename)
577591
utils.delete_file(common.browser_spawn_lock_filename)
578592
utils.delete_file(f'{common.browser_spawn_lock_filename}_counter')

0 commit comments

Comments
 (0)