test: bootstrap DB props in DowngradeAdminsIT and DeletePlayersIT#837
Merged
Conversation
These two ITs called into Getter/Setter without first writing the test database.properties file. Pre-pool (#816) this worked because the application code read the properties file lazily on every call, and the test runtime arranged for the file to exist via other means. Post- pool, ConnectionPool.initialize() is called once per JVM on the first getConnection() and reads the props file exactly once; if it is missing, the pool is marked unusable for the entire JVM and every subsequent test in that fork throws "Connection pool not available". Symptom in CI: every test method in both classes FATAL'd with a long FileNotFoundException stack trace pointing at target/test-classes/conf/database.properties, drowning out any real leak signal in the IT log. Add the standard @BeforeAll bootstrap used by the other 42 IT files (createMysqlResource + ensureSchemaReady + reseedTestData) to both files. Keep the existing @beforeeach for per-test request/response reset. Verified locally: 8 tests pass across the two files (4 each); prior to this fix all 8 failed at pool init.
There was a problem hiding this comment.
Pull request overview
Adds the standard integration-test database bootstrap to two previously-missed servlet IT classes so the test database.properties exists before any Getter/Setter DB call triggers one-shot ConnectionPool.initialize().
Changes:
- Added a
@BeforeAll resetDatabase()block toDowngradeAdminsITto create the MySQL test properties resource and reseed the DB. - Added the same
@BeforeAll resetDatabase()block toDeletePlayersIT.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/it/java/servlets/admin/userManagement/DowngradeAdminsIT.java |
Adds @BeforeAll DB/property bootstrap (create MySQL resource, ensure schema, reseed) to prevent pool init failures when this class runs early in a fork. |
src/it/java/servlets/admin/userManagement/DeletePlayersIT.java |
Same @BeforeAll bootstrap to ensure database.properties exists before any DB access. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two IT files under
src/it/java/servlets/admin/userManagement/were calling intoGetter/Setterwithout first writing the testdatabase.propertiesfile. The other 42 IT files in the suite do this via a standard@BeforeAllblock. These two were missed.Pre-pool (#816) this worked: application code read the properties file lazily on every DB call, and the test runtime arranged for the file to exist via other means.
Post-pool,
ConnectionPool.initialize()runs once per JVM on the firstgetConnection()call and reads the props file exactly once. If the file is missing, the pool is marked unusable for the entire JVM and every subsequent test in that fork throwsConnection pool not available.In CI this looked like a flood of FATAL
FileNotFoundExceptionstack traces drowning out the actual leak signal we're hunting in the integration-tests job. Example seen on the post-#834 dev#536 run:Attribution
This is a latent IT-bootstrap gap that #816's pool-init model surfaced, not a regression from any specific recent PR:
A strategic fix would be to make
TestPropertiesauto-bootstrap on any first DB call from a test JVM, but that is much bigger scope than needed.Changes
DowngradeAdminsIT.java@BeforeAll resetDatabase()withcreateMysqlResource + ensureSchemaReady + reseedTestData. Keep existing@BeforeEach(per-test mock request/response reset).DeletePlayersIT.java26 lines added across the two files. No behavior change beyond the bootstrap.
Verification
All 8 tests now pass (4 per file). Before this fix every one of them FATAL'd at pool init.
Why this matters now
After #834 and #836 closed the high-impact core-pool leaks in
SetterandSetup, the integration-tests job ondev#536still failed — but with two distinct failure modes interleaved:Removing the noise lets us see which challenge family to tackle next.
Test plan
Connection pool not availablecascade from these two classes)