You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Integration tests in a Spring Boot application run in parallel and set a variable using @DynamicPropertySource. Each test is expected to start its own Spring context with separate beans and properties, but properties value is unexpectedly overwritten by other tests.
Reproducer
A small reproducer for the issue has been prepared: GitHub Repository (Java 21, Kotlin, Gradle).
During execution, each test launches a Spring Batch job, passing the assigned parameter value. The job then verifies that this value matches the one in its context. When tests run in parallel, some of them fail because the expected and actual values do not match.
However, when running tests sequentially (without parallelization), all tests pass successfully.
What was tried
set property with @TestPropertySource for each test
use different value for @ActiveProfiles for each test
Description
Integration tests in a Spring Boot application run in parallel and set a variable using
@DynamicPropertySource
. Each test is expected to start its own Spring context with separate beans and properties, but properties value is unexpectedly overwritten by other tests.Reproducer
A small reproducer for the issue has been prepared: GitHub Repository (Java 21, Kotlin, Gradle).
During execution, each test launches a Spring Batch job, passing the assigned parameter value. The job then verifies that this value matches the one in its context. When tests run in parallel, some of them fail because the expected and actual values do not match.
However, when running tests sequentially (without parallelization), all tests pass successfully.
What was tried
@TestPropertySource
for each test@ActiveProfiles
for each testHow to reproduce
Clone https://github.com/verusikk/spring-boot-integration-tests-issue, use README.md commands to run integration tests.
The text was updated successfully, but these errors were encountered: