spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Support alternate `testContextHolder` for `TestContextManager`

Open Kantis opened this issue 1 year ago • 0 comments

Kotest is a Kotlin based testing framework. We execute tests on coroutines, which may (or may not) execute on different threads. As such, the TestContextManager created for a certain class cannot reliably store the TestContext as a ThreadLocal.

We recently received an issue regarding this.

Could you consider providing the means to provide other storage alternatives?

Simply letting us inject or access the ThreadLocal should be sufficient, since we could then add it as a coroutine context element which the coroutine machinery would then take care of.

Kantis avatar May 26 '24 19:05 Kantis