Closed
Description
=== FAIL: coderd/idpsync TestRoleSyncTable/AllTogether (0.00s)
t.go:109: 2025-04-25 08:58:51.042 [erro] idp-sync: failed to parse roles from claim field=bad-claim organization_id=bd03da10-9037-4355-ba73-5a0f5fafc788 user_id=b2469bb2-0f09-425b-81a7-84fa1885921b username=zealous_thompson12 ...
error= failed to parse roles from claim:
github.com/coder/coder/v2/coderd/idpsync.AGPLIDPSync.RolesFromClaim
/home/runner/work/coder/coder/coderd/idpsync/role.go:276
- invalid claim type. Expected an array of strings, got: int:
github.com/coder/coder/v2/coderd/idpsync.ParseStringSliceClaim
/home/runner/work/coder/coder/coderd/idpsync/idpsync.go:220
testing.go:1490: race detected during execution of test
Weirdly, I'm not seeing the usual stacktrace from the race detector...
When I run this test locally, I'm able to replicate the error above but I don't see any race-related output. In fact, the error logs but the test doesn't fail:
$ CGO_ENABLED=1 go test -run 'TestRoleSyncTable' ./coderd/idpsync/... -race -v; echo $?
...
t.go:109: 2025-04-25 09:40:09.522 [erro] idp-sync: failed to parse roles from claim field=bad-claim organization_id=f8ea4538-d63d-465e-a3ad-73894a117cf4 user_id=443418dc-afca-46f5-a50e-1a47cd51f2f7 username=objective_ishizaka2 ...
error= failed to parse roles from claim:
github.com/coder/coder/v2/coderd/idpsync.AGPLIDPSync.RolesFromClaim
/home/coder/coder/coderd/idpsync/role.go:276
- invalid claim type. Expected an array of strings, got: int:
github.com/coder/coder/v2/coderd/idpsync.ParseStringSliceClaim
/home/coder/coder/coderd/idpsync/idpsync.go:220
...
t.go:109: 2025-04-25 09:40:09.524 [erro] idp-sync: failed to parse roles from claim field=bad-claim organization_id=dc8b9eec-3508-46e3-85ef-7a27563ad6c3 user_id=b845e7d1-255c-437c-8c0c-76d314217d3b username=thirsty_margulis83 ...
error= failed to parse roles from claim:
github.com/coder/coder/v2/coderd/idpsync.AGPLIDPSync.RolesFromClaim
/home/coder/coder/coderd/idpsync/role.go:276
- invalid claim type. Expected an array of strings, got: int:
github.com/coder/coder/v2/coderd/idpsync.ParseStringSliceClaim
/home/coder/coder/coderd/idpsync/idpsync.go:220
--- PASS: TestRoleSyncTable (0.00s)
--- PASS: TestRoleSyncTable/AllTogether (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/RawAudit (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/InvalidClaim (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/RoleMapping (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/NoSync (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/EmptyClaim (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/NonExistentClaim (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/NoChange (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/SyncDisabled (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/CustomRole (0.00s)
--- PASS: TestRoleSyncTable/AllTogether/InvalidOriginalRole (0.00s)
--- PASS: TestRoleSyncTable/SyncDisabled (0.00s)
--- PASS: TestRoleSyncTable/EmptyClaim (0.00s)
--- PASS: TestRoleSyncTable/NoSync (0.00s)
--- PASS: TestRoleSyncTable/NonExistentClaim (0.00s)
--- PASS: TestRoleSyncTable/InvalidOriginalRole (0.00s)
--- PASS: TestRoleSyncTable/RoleMapping (0.00s)
--- PASS: TestRoleSyncTable/CustomRole (0.00s)
--- PASS: TestRoleSyncTable/NoChange (0.00s)
--- PASS: TestRoleSyncTable/InvalidClaim (0.00s)
--- PASS: TestRoleSyncTable/RawAudit (0.00s)
PASS
ok github.com/coder/coder/v2/coderd/idpsync 1.061s
0