mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test: do not run memory race test in parallel (#17582)
Closes https://github.com/coder/internal/issues/597#issuecomment-2835262922 The parallelized tests share configs, which when accessed concurrently throw race errors. The configs are read only, so it is fine to run these tests with shared idp configs.
This commit is contained in:
@@ -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{}),
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user