Clean up open connections to fix test failures on omni and appveyor #2251
+55
−50
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.
The omni CI and appveyor are failing on some of the older server versions. Couple unrelated causes.
First is #2245 added some DDL for adding a
COMMENT ON FUNCTION ... f ...
(rather thanf()
) that only works on server v10+.Second is that some tests were creating connections but not closing them. Again on some older versions and on appveyor this was leading to connection exhaustion. Same PR had one offender and I found another in Statement Test.
Finally, the new test added in #2247 was failing on v8.4 as updating
application_name
is not supported.This PR should fix all of that. The StatementTest change is just a wrapping that block in try-with-resources so viewing the diff with whitespaced ignored is a easier:
I've got it running the omni action on my branch: https://github.com/sehrope/pgjdbc/actions/runs/1224062070. Once it passes I'll merge this in.