As we were forced to use “embedded postgres” since 2025.06, our spring boot tests have grown incredibly slow (we’re at 20+ mins for only 27 tests on Jenkins).
Using H2, our tests were way faster, by a factor of five or so:
Is there a way to switch back to H2 for spring boot tests?
Even if your project would have the resources invested to make your tests work against H2, what would that be telling you? H2 is not officially supported. So this means your test results wouldn’t reliably tell you whether your application works with postgres as well. You would also constantly run into problems with A12 upgrades making them even more costly as they probably are already. Would this really pay off in a long run?
Instead have you measured what is so slow in your tests? Maybe there is things you or A12 can improve.
Hello @juergen-smooth-ice, I am a member of the Discourse team. I can see that there was a new response to your question on Use of H2 for spring boot tests. Do you find it helpful, or should the question remain open?
Thanks ahead for your feedback and have a nice rest of the day!
My take is that it simply doesn’t work - and that I have to live with my frustration about long running spring boot tests.