Skip to content

flake: TestRoleSyncTable/AllTogether #597

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

Closed
dannykopping opened this issue Apr 25, 2025 · 4 comments · Fixed by coder/coder#17582
Closed

flake: TestRoleSyncTable/AllTogether #597

dannykopping opened this issue Apr 25, 2025 · 4 comments · Fixed by coder/coder#17582
Assignees
Labels

Comments

@dannykopping
Copy link
Collaborator

Seen here and here

=== 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
@ethanndickson
Copy link
Member

@dannykopping
Copy link
Collaborator Author

@ethanndickson
Copy link
Member

I've been running into this a lot, here's one with a Go race stacktrace https://github.com/coder/coder/actions/runs/14708159962/job/41273440327

@Emyrk
Copy link
Member

Emyrk commented Apr 28, 2025

This fixes it: coder/coder#17582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants