- Notifications
You must be signed in to change notification settings - Fork1k
Fix socket leak, clean up single use postgres databases#2413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
Signed-off-by: Spike Curtis <spike@coder.com>
kylecarbs approved these changesJun 16, 2022
johnstcn approved these changesJun 16, 2022
mafredri approved these changesJun 16, 2022
// MigrateUp runs SQL migrations to ensure the database schema is up-to-date. | ||
funcMigrateUp(db*sql.DB)error { | ||
funcMigrateUp(db*sql.DB)(retErrerror) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Tip (non-blocking): It would be OK to call thiserr
, at the timedefer func
runs, the value oferr
would be that of thereturn
statement.
Uh oh!
There was an error while loading.Please reload this page.
Signed-off-by: Spike Curtis <spike@coder.com>
Sign up for freeto 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.
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.