python 3.14: fix canfail related tests#51697
Merged
Conversation
canfail related tests
* Use an attribute instead of environment variables to make the package fail to build. This fixes a problem when using forkserver as a multiprocessing start method, which does not inherit the environment variable changes, unlike fork and spawn. * Fix the tests which assumed the `canfail` package would fail without telling it to. The tests passed because a previous test would set an environment variable in the current process. Oops. Signed-off-by: Harmen Stoppels <[email protected]>
10dc488 to
c04d069
Compare
alalazo
approved these changes
Dec 8, 2025
Merged
becker33
pushed a commit
that referenced
this pull request
Feb 2, 2026
* Use an attribute instead of environment variables to make the package fail to build. This fixes a problem when using forkserver as a multiprocessing start method, which does not inherit the environment variable changes, unlike fork and spawn. * Fix the tests which assumed the `canfail` package would fail without telling it to. The tests passed because a previous test would set an environment variable in the current process. Signed-off-by: Harmen Stoppels <[email protected]>
becker33
pushed a commit
that referenced
this pull request
Feb 2, 2026
* Use an attribute instead of environment variables to make the package fail to build. This fixes a problem when using forkserver as a multiprocessing start method, which does not inherit the environment variable changes, unlike fork and spawn. * Fix the tests which assumed the `canfail` package would fail without telling it to. The tests passed because a previous test would set an environment variable in the current process. Signed-off-by: Harmen Stoppels <[email protected]> Signed-off-by: Gregory Becker <[email protected]>
becker33
pushed a commit
that referenced
this pull request
Feb 19, 2026
* Use an attribute instead of environment variables to make the package fail to build. This fixes a problem when using forkserver as a multiprocessing start method, which does not inherit the environment variable changes, unlike fork and spawn. * Fix the tests which assumed the `canfail` package would fail without telling it to. The tests passed because a previous test would set an environment variable in the current process. Signed-off-by: Harmen Stoppels <[email protected]> Signed-off-by: Gregory Becker <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tests that rely on canfail to fail dynamically are broken under a
forkserver multiprocessing strategy, because the environment variables set in
the parent process are not inherited by the subprocess of the installer (at least
not the second invocation after changes in the parent process).
We can just use attributes because the package is serialized in case of spawn
and forkserver (and obvsly it works with forking).
However, the amazing spack builder logic caches the builder per package
instance, and the builder copies the package's
__dict__, meaning we have toforce that cache to be cleared after mutating a package property. That's likely
the reason environment variables were used.