Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,19 @@ 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_')):
entry = os.path.join(shared.TEMP_DIR, entry)
try:
if os.path.isdir(entry):
utils.delete_dir(entry)
except Exception:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using force_delete_dir here... then I think you don't need the try/catch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

force_delete_dir() raises an exception if the deletion failed. The thinking here was that it wouldn't be catastrophic if that happens.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough



def main():
options = parse_args()

Expand Down Expand Up @@ -573,6 +586,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')
Expand Down