Skip to content

Commit d4faef6

Browse files
committed
fix: test race (#9469)
Signed-off-by: Michael Crenshaw <michael@crenshaw.dev>
1 parent af45491 commit d4faef6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/server_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ func TestAuthenticate_3rd_party_JWTs(t *testing.T) {
598598
t.Run(testDataCopy.test, func(t *testing.T) {
599599
t.Parallel()
600600

601+
// Must be declared here to avoid race.
602+
ctx := context.Background() //nolint:ineffassign,staticcheck
603+
601604
argocd, dexURL := getTestServer(t, testDataCopy.anonymousEnabled, true)
602605
ctx := context.Background()
603606
testDataCopy.claims.Issuer = fmt.Sprintf("%s/api/dex", dexURL)
@@ -695,6 +698,9 @@ func TestAuthenticate_no_SSO(t *testing.T) {
695698
t.Run(testDataCopy.test, func(t *testing.T) {
696699
t.Parallel()
697700

701+
// Must be declared here to avoid race.
702+
ctx := context.Background() //nolint:ineffassign,staticcheck
703+
698704
argocd, dexURL := getTestServer(t, testDataCopy.anonymousEnabled, false)
699705
ctx := context.Background()
700706
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.RegisteredClaims{Issuer: fmt.Sprintf("%s/api/dex", dexURL)})

0 commit comments

Comments
 (0)