Skip to content

Conversation

spikecurtis
Copy link
Contributor

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.

@spikecurtis spikecurtis requested a review from a team June 16, 2022 15:27
@@ -36,8 +46,19 @@ func migrateSetup(db *sql.DB) (source.Driver, *migrate.Migrate, error) {
}

// MigrateUp runs SQL migrations to ensure the database schema is up-to-date.
func MigrateUp(db *sql.DB) error {
func MigrateUp(db *sql.DB) (retErr error) {
Copy link
Member

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 this err, at the time defer func runs, the value of err would be that of the return statement.

Signed-off-by: Spike Curtis <spike@coder.com>
@spikecurtis spikecurtis merged commit a82c0eb into main Jun 16, 2022
@spikecurtis spikecurtis deleted the spike/2347_postgres_flakes branch June 16, 2022 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy