Increase max connections for postgres container, use smaller hikari pool#1719
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
Test Results479 tests 477 ✅ 5m 53s ⏱️ For more details on these failures, see this check. Results for commit ae8d0b0. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts PostgreSQL and Hikari connection limits to prevent connection exhaustion during integration testing.
Changes:
- Increase PostgreSQL
max_connectionsin the CI docker-compose Postgres service. - Reduce HikariCP maximum pool size in the PostgreSQL test profile properties.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/test/resources/application-postgresql.properties | Limits HikariCP pool size during PostgreSQL-backed tests to reduce concurrent DB connections. |
| build/ci/docker-compose.yml | Raises PostgreSQL server-side connection cap for the CI container. |
|
Interesting. Can we use a strategic |
…connections during integration tests, also use half of the default pool size to prevent exhausting the connections
a9edda2 to
ae8d0b0
Compare
maybe; but we would need to analyse the cached instances and I expect the testsuite would take more time: @DirtiesContext because the perhaps easier to specify Also see: Spring @DirtiesContext — false friend |
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
Would indeed require analysis which tests create another context, but the point would be to add that annotation to a test that creates a new context anyway (hence increasing the number of database connections), which would not be reused. But the cache max size is probably easier! |
Increase max connections for the "postgres" container as it can run out of connections during integration tests, also use half of the default pool size to prevent exhausting the connections.
Applies:
to prevent connection exhaust problems during integration testing.
A comprehensive write-up in https://stackoverflow.com/questions/79028148/hikari-pool-is-not-shutdown-after-spring-boot-test-execution-with-test-container
Worth reading: https://commerce-engineer.rakuten.careers/entry/en/tech/0054