Skip to content
Open
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
17 changes: 10 additions & 7 deletions test/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,9 @@ def configure():
browser_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."""
def cleanup_temp_directory():
"""Deletes all files and directories in TEMP_DIR 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)
Expand Down Expand Up @@ -716,10 +716,13 @@ def set_env(name, option_value):

check_js_engines()

# Remove any old test files before starting the run. Skip cleanup when we're running in debug mode
# where we want to preserve any files created (e.g. emscripten.lock from shared.py).
if not (shared.DEBUG or common.EMTEST_SAVE_DIR):
cleanup_emscripten_temp()
# Remove any old test files before starting the run. Skip cleanup when we're
# running in debug mode where we want to preserve any files created (e.g.
# emscripten.lock from shared.py).
# Note: We only do this in the CI environment, since it prevents multiple
# emscripten checkouts from running tests at the same time.
if os.getenv('CI') and not (shared.DEBUG or common.EMTEST_SAVE_DIR):
cleanup_temp_directory()
utils.delete_file(common.flaky_tests_log_filename)

browser_common.init(options.force_browser_process_termination)
Expand Down
Loading