Yonatan Karp-Rudin
06/22/2026, 10:14 AMOliver.O
06/22/2026, 10:55 AMYonatan Karp-Rudin
06/22/2026, 11:58 AMOliver.O
06/22/2026, 12:46 PMYonatan Karp-Rudin
06/22/2026, 1:48 PMApplicationContext itself isn't what breaks parallel tests. What serializes a suite is the database (and anything external the beans touch), plus the JVM-wide TestContext cache that shares singletons across test classes with identical config. In my wrapper there's one more piece: inside a single springTest block the tests share one context and a set of mocks that get `clearMocks`'d before each test, so those mocks are shared mutable state too.
On building isolated tests that parallelize: yes, at the granularity of a suite rather than an individual test, and the wrapper already works that way. Each springTest block builds its own context, and the registry that hands the mocks to it is a ThreadLocal, so two suites loading on different threads don't interfere. What isn't parallel-safe is the tests inside one block: they share the context and the mocks, and one of my own suites even depends on ordering and a shared var. So the unit of parallelism here is the suite, internally sequential, which is the level your scheduler would work at.
I guess that the main concern is that SpringBoot isn't Kotlin first framework and while supporting Coroutines OOTB they're not 1st class citizens (for example the ThreadLocal above)Oliver.O
06/22/2026, 10:38 PMOn building isolated tests that parallelize: yes, at the granularity of a suite rather than an individual testThis can be expressed with TestBalloon, as we can switch between sequential and concurrent invocation at any level of the test element hierarchy. For example, we could use concurrent invocation for the entire session
TestSession(testConfig = TestConfig.invocation(TestConfig.Invocation.Concurrent))
and then choose
testConfig = TestConfig.invocation(TestConfig.Invocation.Sequential)
specifically for the respective Spring Boot test suites.
I guess that the main concern is that SpringBoot isn't Kotlin first framework and while supporting Coroutines OOTB they're not 1st class citizens (for example theI probably need to dig into this a bit further, but having a system under test which assumes a threading model doesn't necessarily hurt. Coroutines can provide threading guarantees if needed (e.g. UI-based systems typically rely on a main thread). And even if not used inside tests, coroutines can help organize parallel execution. But if I understand your library correctly, like elsewhere with TestBalloon, we can immediately use plain Kotlin to parameterize and structure tests. Is this something you'd like to maintain as an external integration for TestBalloon? Or would you prefer having Spring Boot support inside TestBalloon? In any case, I'd be happy to look into all the details and discuss implementation aspects.above)ThreadLocal
dave08
06/23/2026, 2:04 AMYonatan Karp-Rudin
06/23/2026, 1:05 PM@DirtyCotnext and @Tranaactional annotation on a method for exampleOliver.O
06/23/2026, 10:15 PM