Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Avoid modifying '17 prebuild shared' test dir #13991

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

heftig
Copy link
Contributor

@heftig heftig commented Dec 9, 2024

Tests can tread on each other's toes when parallelism is high enough.

In this case, test_prebuilt_shared_lib creates an object file in the 17 prebuilt shared test dir.

test_prebuilt_shared_lib_rpath_same_prefix uses shutil.copytree to copy that same test dir to a temporary location.

If the former test cleans up its object file while copytree is running, the copy can fail with a fatal ENOENT shutil.Error.

Use copy_srcdir to prevent this from happening.

@heftig heftig requested a review from jpakkane as a code owner December 9, 2024 15:28
@eli-schwartz
Copy link
Member

Use copy_srcdir in all tests that modify the testdir (that I spotted) to prevent this from happening.

I think that this should only be an issue for test_prebuilt_shared_lib, not the others. There are other tests as well which modify the source directory, e.g. test_prebuilt_static just above -- but that's fine because it's the only test that uses that directory so it won't stomp on the other test via parallelism.

In general, any test that has self.addCleanup() calls is modifying the testdir in some manner

Tests can tread on each other's toes when parallelism is high enough.

In this case, `test_prebuilt_shared_lib` creates an object file in the
`17 prebuilt shared` test dir.

`test_prebuilt_shared_lib_rpath_same_prefix` uses `shutil.copytree` to
copy that same test dir to a temporary location.

If the former test cleans up its object file while `copytree` is
running, the copy can fail with a fatal ENOENT `shutil.Error`.

Use `copy_srcdir` to prevent this from happening.
@heftig heftig force-pushed the allplatformtests-race branch from c71b0e0 to 75e6ec7 Compare January 4, 2025 04:31
@heftig
Copy link
Contributor Author

heftig commented Jan 4, 2025

Reduced to just the one case that triggers the crash.

@heftig heftig changed the title tests: Avoid modifying test dirs in allplatformtests tests: Avoid modifying '17 prebuild shared' test dir Jan 4, 2025
@jpakkane jpakkane merged commit 29a26ea into mesonbuild:master Jan 7, 2025
31 of 32 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