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

JUnit extensions need to deal w/ concurrent tests #747

Open
eeverman opened this issue Nov 29, 2022 · 0 comments
Open

JUnit extensions need to deal w/ concurrent tests #747

eeverman opened this issue Nov 29, 2022 · 0 comments
Labels
Milestone

Comments

@eeverman
Copy link
Owner

AndHow's JUnit extensions currently ignore the possible issues with concurrent tests. Since AndHow is a singleton model, it will cause problems if its state changes due to the KillAndHowXXX extensions. Similarly, the system prop and jndi extensions can cause similar issues.

JUnit has a mechanism to mark tests to lock resources for read or write. This should be used, though it is new in JUnit 5.3 (seems a reasonable version expectation).

Additionally, this should be documented better, perhaps a whole section of documentation on parallel testing.

AndHow will be in an unconfigured state prior to the first access, and since test order is unknown, the state of tests is technically different each time. It might be good to force AndHow to initialize somehow... Maybe a separate auto-detect API to force initialization similar to auto-configuration??

Its hard to know what tests will use AndHow because it is, by design, deep into classes. Thus, nearly all tests require a marker of @ResourceLock(value = ANDHOW_KEY , mode = READ). Any test that modifies AndHow state in any way should have a READ_WRITE mode marked.

@eeverman eeverman added the bug label Nov 29, 2022
@eeverman eeverman added this to the 1.5.1 milestone Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant