Fix socket leak, clean up single use postgres databases #2413
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.
First PR for #2347
This fixes up a socket leak in our use of Migrate.
It also introduces cleanup of single-use databases in postgres, since the postgres container outlives the test run, if we don't clean up these databases the container will continue to grow in size until it is restarted.
Lastly, this extends the timeout for postgres tests to 30 minutes. I'm seeing several minutes on my machine, and we don't want to set this aspirationally---it's a backstop for when things are going really wrong. It removes the limit of 1 parallel test per package, on the theory that the socket leak was actually the source of our CI problems. We can add parallel limits back in if the CI buckles under this pressure.