Skip to content

Commit 9f39cee

Browse files
committed
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.
1 parent a595919 commit 9f39cee

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/runner.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,17 @@ 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+
try:
534+
utils.delete_dir(os.path.join(shared.TEMP_DIR, entry))
535+
except Exception as e:
536+
pass
537+
538+
528539
def main():
529540
options = parse_args()
530541

@@ -573,6 +584,7 @@ def set_env(name, option_value):
573584
check_js_engines()
574585

575586
# Remove any old test files before starting the run
587+
cleanup_emscripten_temp()
576588
utils.delete_file(common.flaky_tests_log_filename)
577589
utils.delete_file(common.browser_spawn_lock_filename)
578590
utils.delete_file(f'{common.browser_spawn_lock_filename}_counter')

0 commit comments

Comments
 (0)