In this session we'll talk about how Spring Integration Test Framework works under the hood, how the contexts are cached and reused in subsequent tests. The existing solution can be quite convenient, efficient and flexible, but on a large scale with lots of modules, tests and heavy-weight beans like TestContainers-handled docker containers suite executions may lead to OOM failures and take too much time.
To address these problems we'll first consider practical steps like trivial ones and then do few tricks like test reordering and smart context closing logic.
Overall these optimizations can have significant optimization effect - both for memory and execution time, also better stability.
There is a project with the solution https://github.com/seregamorph/spring-test-smart-context - here you can find more details.
This idea was submitted to Spring Core team https://github.com/spring-projects/spring-framework/issues/32289 and accepted to the backlog, the initial feedback is quite positive.
To address these problems we'll first consider practical steps like trivial ones and then do few tricks like test reordering and smart context closing logic.
Overall these optimizations can have significant optimization effect - both for memory and execution time, also better stability.
There is a project with the solution https://github.com/seregamorph/spring-test-smart-context - here you can find more details.
This idea was submitted to Spring Core team https://github.com/spring-projects/spring-framework/issues/32289 and accepted to the backlog, the initial feedback is quite positive.
