This https://stackoverflow.com/a/65952397/6508873 was useful answer for me. I have put @DirtiesContext
to my tests that use testcontainers and it solved no more exceptions like:
java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30008ms (total=10, active=10, idle=0, waiting=0)