You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiple tests that make use of a Postgres container configured via test-resources will share the database container and not restart it for each separate test class. This is the default behavior as described in "Isolating Test Resources" under 5.2 JUnit Platform
Actual Behaviour
Postgres container is restarted for every test class containing a @MicronautTest annotation. This nearly doubles our test runtime. Was able to work around it by appending TC_REUSABLE to the datasource URL as a la: datasources.default.url: jdbc:tc:postgresql:16:///postgres;TC_REUSABLE=true
Steps To Reproduce
Given a fresh application and the following config:
Can you share a complete reproducer? There must be something else at play because this is definitely not how it works (we have a lot of test suites which definitely share the same container).
Expected Behavior
Multiple tests that make use of a Postgres container configured via test-resources will share the database container and not restart it for each separate test class. This is the default behavior as described in "Isolating Test Resources" under 5.2 JUnit Platform
Actual Behaviour
Postgres container is restarted for every test class containing a
@MicronautTest
annotation. This nearly doubles our test runtime. Was able to work around it by appendingTC_REUSABLE
to the datasource URL as a la:datasources.default.url: jdbc:tc:postgresql:16:///postgres;TC_REUSABLE=true
Steps To Reproduce
@MicronautTest
Environment Information
MacOS 14.2.1
Java 21.0.2-tem
Docker Desktop 4.28.0
Example Application
No response
Version
4.3.4
The text was updated successfully, but these errors were encountered: