Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14105ff

Browse files
authored
test: do not run memory race test in parallel (#17582)
Closescoder/internal#597 (comment)The parallelized tests share configs, which when accessed concurrentlythrow race errors. The configs are read only, so it is fine to run thesetests with shared idp configs.
1 parentb9177ef commit14105ff

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

‎coderd/idpsync/group_test.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ func TestParseGroupClaims(t *testing.T) {
6565
})
6666
}
6767

68+
//nolint:paralleltest, tparallel
6869
funcTestGroupSyncTable(t*testing.T) {
6970
t.Parallel()
7071

@@ -248,9 +249,11 @@ func TestGroupSyncTable(t *testing.T) {
248249

249250
for_,tc:=rangetestCases {
250251
tc:=tc
252+
// The final test, "AllTogether", cannot run in parallel.
253+
// These tests are nearly instant using the memory db, so
254+
// this is still fast without being in parallel.
255+
//nolint:paralleltest, tparallel
251256
t.Run(tc.Name,func(t*testing.T) {
252-
t.Parallel()
253-
254257
db,_:=dbtestutil.NewDB(t)
255258
manager:=runtimeconfig.NewManager()
256259
s:=idpsync.NewAGPLSync(slogtest.Make(t,&slogtest.Options{}),
@@ -289,9 +292,8 @@ func TestGroupSyncTable(t *testing.T) {
289292
// deployment. This tests all organizations being synced together.
290293
// The reason we do them individually, is that it is much easier to
291294
// debug a single test case.
295+
//nolint:paralleltest, tparallel // This should run after all the individual tests
292296
t.Run("AllTogether",func(t*testing.T) {
293-
t.Parallel()
294-
295297
db,_:=dbtestutil.NewDB(t)
296298
manager:=runtimeconfig.NewManager()
297299
s:=idpsync.NewAGPLSync(slogtest.Make(t,&slogtest.Options{}),

‎coderd/idpsync/role_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/coder/coder/v2/testutil"
2424
)
2525

26+
//nolint:paralleltest, tparallel
2627
funcTestRoleSyncTable(t*testing.T) {
2728
t.Parallel()
2829

@@ -190,9 +191,11 @@ func TestRoleSyncTable(t *testing.T) {
190191

191192
for_,tc:=rangetestCases {
192193
tc:=tc
194+
// The final test, "AllTogether", cannot run in parallel.
195+
// These tests are nearly instant using the memory db, so
196+
// this is still fast without being in parallel.
197+
//nolint:paralleltest, tparallel
193198
t.Run(tc.Name,func(t*testing.T) {
194-
t.Parallel()
195-
196199
db,_:=dbtestutil.NewDB(t)
197200
manager:=runtimeconfig.NewManager()
198201
s:=idpsync.NewAGPLSync(slogtest.Make(t,&slogtest.Options{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp