diff --git a/coderd/idpsync/group_test.go b/coderd/idpsync/group_test.go index 4a892964a9aa7..58024ed2f6f8f 100644 --- a/coderd/idpsync/group_test.go +++ b/coderd/idpsync/group_test.go @@ -65,6 +65,7 @@ func TestParseGroupClaims(t *testing.T) { }) } +//nolint:paralleltest, tparallel func TestGroupSyncTable(t *testing.T) { t.Parallel() @@ -248,9 +249,11 @@ func TestGroupSyncTable(t *testing.T) { for _, tc := range testCases { tc := tc + // The final test, "AllTogether", cannot run in parallel. + // These tests are nearly instant using the memory db, so + // this is still fast without being in parallel. + //nolint:paralleltest, tparallel t.Run(tc.Name, func(t *testing.T) { - t.Parallel() - db, _ := dbtestutil.NewDB(t) manager := runtimeconfig.NewManager() s := idpsync.NewAGPLSync(slogtest.Make(t, &slogtest.Options{}), @@ -289,9 +292,8 @@ func TestGroupSyncTable(t *testing.T) { // deployment. This tests all organizations being synced together. // The reason we do them individually, is that it is much easier to // debug a single test case. + //nolint:paralleltest, tparallel // This should run after all the individual tests t.Run("AllTogether", func(t *testing.T) { - t.Parallel() - db, _ := dbtestutil.NewDB(t) manager := runtimeconfig.NewManager() s := idpsync.NewAGPLSync(slogtest.Make(t, &slogtest.Options{}), diff --git a/coderd/idpsync/role_test.go b/coderd/idpsync/role_test.go index d766ada6057f7..f1cebc1884453 100644 --- a/coderd/idpsync/role_test.go +++ b/coderd/idpsync/role_test.go @@ -23,6 +23,7 @@ import ( "github.com/coder/coder/v2/testutil" ) +//nolint:paralleltest, tparallel func TestRoleSyncTable(t *testing.T) { t.Parallel() @@ -190,9 +191,11 @@ func TestRoleSyncTable(t *testing.T) { for _, tc := range testCases { tc := tc + // The final test, "AllTogether", cannot run in parallel. + // These tests are nearly instant using the memory db, so + // this is still fast without being in parallel. + //nolint:paralleltest, tparallel t.Run(tc.Name, func(t *testing.T) { - t.Parallel() - db, _ := dbtestutil.NewDB(t) manager := runtimeconfig.NewManager() s := idpsync.NewAGPLSync(slogtest.Make(t, &slogtest.Options{