Skip to content

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 <[email protected]>
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