SystemPropertyHelper is not thread safe #265
Unanswered
sleberknight
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
SystemPropertyHelper
is used by tests to verify behavior ofConfigProvider
classes that support system properties.This class uses a static
Set<String
and has onlystatic
methods, which means it is not thread-safe and therefore cannot ever be used by parallel tests.Rather than trying to fix this ourselves, we should consider using JUnit Pioneer's ability to set and clear system properties. It attempts to handle thread-safety by using JUnit 5 resource locks to prevent tests annotated with its annotations won't execute in parallel. They also note that it cannot cover all possible cases, which is important to understand.
Beta Was this translation helpful? Give feedback.
All reactions