Skip to content

Conversation

@brendandahl
Copy link
Collaborator

@brendandahl brendandahl commented Jan 14, 2026

cleanup_emscripten_temp() was run at the beginning of tests and caused the emscripten.lock file that was created earlier to be removed. Then when test was finished it attempted to delete that lock file again.

test/runner.py Outdated
"""Deletes all files and directories under Emscripten
that look like they might have been created by Emscripten."""
if shared.DEBUG or common.EMTEST_SAVE_DIR:
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe add comment here? What is the lock file in question?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

emscripten.lock from FileLock

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it would be useful to add a logging.debug('Not cleaning temp since running in debug/EM_SAVE_DIR mode') line before return?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not a huge fan of auto deleting stuff at the beginning. I'd prefer tests clean up on their own at the end, so I was thinking we reverse this, where if a file is found, we error out, add an option that clears the files on start. e.g. "Test runner found emscripten temporary files. Re-run with --clear-temp-files to remove them."

Copy link
Collaborator

Choose a reason for hiding this comment

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

A related PR which should dramatically reduce the number of emscripten-related tmp directories: #25615

@juj
Copy link
Collaborator

juj commented Jan 15, 2026

Ooh, this might be what is causing the issue in my CI failing in a number of parallel tests, where some tests fail to link, complaining of a missing library.

@juj
Copy link
Collaborator

juj commented Jan 15, 2026

What kind of scenario are you seeing this happen, actually? Is this when you do a parallel test run? Or when you manually set EMCC_DEBUG before doing a parallel run?

Or are there some individual tests that enable EMCC_DEBUG on their own? (I think we have/had some of those at some point)

@brendandahl
Copy link
Collaborator Author

What kind of scenario are you seeing this happen, actually? Is this when you do a parallel test run? Or when you manually set EMCC_DEBUG before doing a parallel run?

Or are there some individual tests that enable EMCC_DEBUG on their own? (I think we have/had some of those at some point)

Running a single test with EMCC_DEBUG triggers it for me. e.g. EMCC_DEBUG=1 test/runner other.test_embind_tsgen_ignore_6

`cleanup_emscripten_temp()` is run at the beginning of tests and caused
the lock file that was created to be removed. Then when test was
finished it attempted to delete that lock file.
@brendandahl brendandahl merged commit bed4a48 into emscripten-core:main Jan 16, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants