Skip to content

GH-1295 - Replace HashMap with ConcurrentHashMap for thread safety #1298

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yevheniisemenov
Copy link

Replace static HashMap fields with ConcurrentHashMap in ModuleTestExecution and PackageName to ensure thread-safe access during concurrent test execution.

Closes gh-1295

…hread safety

Replace static HashMap fields with ConcurrentHashMap in ModuleTestExecution
and PackageName to ensure thread-safe access during concurrent test execution.

Closes spring-projectsgh-1295

Signed-off-by: Yevhenii Semenov <zhe.semenov@gmail.com>
class ModuleTestExecutionUnitTests {

@Test
void concurrentAccessToExecutionCacheIsSafe() throws InterruptedException {
Copy link
Author

Choose a reason for hiding this comment

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

I have checked that the test now passes and fails again when I revert ConcurrentHashMap to HashMap.

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.

Potential ConcurrentModificationException when running @ApplicationModuleTest tests in parallel
1 participant