diff --git a/test/preflight/apps_v2_integration_test.go b/test/preflight/apps_v2_integration_test.go index b3f8b75efc..bbdf9faeff 100644 --- a/test/preflight/apps_v2_integration_test.go +++ b/test/preflight/apps_v2_integration_test.go @@ -415,7 +415,19 @@ func TestLaunchDetach(t *testing.T) { require.Contains(f, res.StdOutString(), "success") } -func TestDeployDetach(t *testing.T) { +func WithParallel(f func(*testing.T)) func(*testing.T) { + return func(t *testing.T) { + t.Parallel() + f(t) + } +} + +func TestDeploy(t *testing.T) { + t.Run("Detach", WithParallel(testDeployDetach)) + t.Run("DetachBatching", WithParallel(testDeployDetachBatching)) +} + +func testDeployDetach(t *testing.T) { f := testlib.NewTestEnvFromEnv(t) appName := f.CreateRandomAppName() @@ -428,7 +440,7 @@ func TestDeployDetach(t *testing.T) { require.Contains(f, res.StdOutString(), "started") } -func TestDeployDetachBatching(t *testing.T) { +func testDeployDetachBatching(t *testing.T) { f := testlib.NewTestEnvFromEnv(t) appName := f.CreateRandomAppName() diff --git a/test/preflight/fly_postgres_test.go b/test/preflight/fly_postgres_test.go index d1b28a78e9..111b8f1e03 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("Success", 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 @@ -188,14 +193,11 @@ func TestPostgres_ImportSuccess(t *testing.T) { firstAppName := f.CreateRandomAppName() secondAppName := f.CreateRandomAppName() + t.Logf("Create app_names table on %s", firstAppName) f.Fly( "pg create --org %s --name %s --region %s --initial-cluster-size 1 --vm-size %s --volume-size 1 --password x", f.OrgSlug(), firstAppName, f.PrimaryRegion(), postgresMachineSize, ) - f.Fly( - "pg create --org %s --name %s --region %s --initial-cluster-size 1 --vm-size %s --volume-size 1", - f.OrgSlug(), secondAppName, f.PrimaryRegion(), postgresMachineSize, - ) assert.EventuallyWithT(t, func(c *assert.CollectT) { assertPostgresIsUp(t, f, firstAppName) }, 1*time.Minute, 10*time.Second) @@ -209,6 +211,14 @@ func TestPostgres_ImportSuccess(t *testing.T) { firstAppName, firstAppName, ) + t.Logf("Import from %s to %s", firstAppName, secondAppName) + f.Fly( + "pg create --org %s --name %s --region %s --initial-cluster-size 1 --vm-size %s --volume-size 1", + f.OrgSlug(), secondAppName, f.PrimaryRegion(), postgresMachineSize, + ) + assert.EventuallyWithT(t, func(c *assert.CollectT) { + assertPostgresIsUp(t, f, secondAppName) + }, 1*time.Minute, 10*time.Second) f.Fly( "pg import -a %s --region %s --vm-size %s postgres://postgres:x@%s.internal/postgres", secondAppName, f.PrimaryRegion(), postgresMachineSize, firstAppName, @@ -227,7 +237,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