Skip to content

test(coderd/database): use seperate context for subtests to fix flake #19330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions coderd/database/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6009,10 +6009,10 @@ func TestUserSecretsCRUDOperations(t *testing.T) {

// Use raw database without dbauthz wrapper for this test
db, _ := dbtestutil.NewDB(t)
ctx := testutil.Context(t, testutil.WaitMedium)

t.Run("FullCRUDWorkflow", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitMedium)

// Create a new user for this test
testUser := dbgen.User(t, db, database.User{})
Expand Down Expand Up @@ -6085,6 +6085,7 @@ func TestUserSecretsCRUDOperations(t *testing.T) {

t.Run("UniqueConstraints", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitMedium)

// Create a new user for this test
testUser := dbgen.User(t, db, database.User{})
Expand Down Expand Up @@ -6156,7 +6157,6 @@ func TestUserSecretsAuthorization(t *testing.T) {
db, _ := dbtestutil.NewDB(t)
authorizer := rbac.NewStrictCachingAuthorizer(prometheus.NewRegistry())
authDB := dbauthz.New(db, authorizer, slogtest.Make(t, &slogtest.Options{}), coderdtest.AccessControlStorePointer())
ctx := testutil.Context(t, testutil.WaitMedium)

// Create test users
user1 := dbgen.User(t, db, database.User{})
Expand Down Expand Up @@ -6234,6 +6234,7 @@ func TestUserSecretsAuthorization(t *testing.T) {
tc := tc // capture range variable
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitMedium)

authCtx := dbauthz.As(ctx, tc.subject)

Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy