From 38674725ca53f245024a4a4faaa668a51a1e2f8b Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Wed, 21 Aug 2024 22:30:51 -0700 Subject: [PATCH] test: run slow `fly pg import` tests in parallel --- test/preflight/fly_postgres_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/preflight/fly_postgres_test.go b/test/preflight/fly_postgres_test.go index d1b28a78e9..acc58958a7 100644 --- a/test/preflight/fly_postgres_test.go +++ b/test/preflight/fly_postgres_test.go @@ -176,7 +176,12 @@ func assertPostgresIsUp(tb testing.TB, f *testlib.FlyctlTestEnv, appName string) assert.Equal(tb, 0, ssh.ExitCode(), "failed to connect to postgres at %s: %s", appName, ssh.StdErr()) } -func TestPostgres_ImportSuccess(t *testing.T) { +func TestPostgresImport(t *testing.T) { + t.Run("Import", WithParallel(testPostgresImportSuccess)) + t.Run("Failure", WithParallel(testPostgresImportFailure)) +} + +func testPostgresImportSuccess(t *testing.T) { f := testlib.NewTestEnvFromEnv(t) // Since this explicitly sets a size, no need to test on GPUs/alternate @@ -227,7 +232,7 @@ func TestPostgres_ImportSuccess(t *testing.T) { }, 2*time.Minute, 10*time.Second, "import machine not destroyed") } -func TestPostgres_ImportFailure(t *testing.T) { +func testPostgresImportFailure(t *testing.T) { f := testlib.NewTestEnvFromEnv(t) // Since this explicitly sets a size, no need to test on GPUs/alternate