Skip to content

Intermittent failure: concurrent exchanges of one code (revoke then save) reads back an undefined token #201

Open

Description

@KyleJune

src/server/resource-indicators-code.test.ts > additional resource binding cases > never issues an unbound or mismatched token from concurrent exchanges of one code (revoke then save) failed once on Node 22 (ubuntu-latest) in CI run https://github.com/udibo/oauth2/actions/runs/43208043949/job/131148137883, on a PR that does not touch the server (#200). It passes locally 5/5 and on main.

Failure: AssertionError: expected undefined to be 'https://mcp.example.com/mcp' at the (await f.tokenService.getToken(body.access_token))?.resource assertion, so the matching exchange returned 200 but its access token could not be read back.

Likely cause (UNVERIFIED): in the revoke-then-save mode, the losing exchange can treat the code as replayed and revoke the tokens issued from it after the winner saved them, so the token is gone by the time the test reads it. If so, the test should accept a revoked token in that interleaving (or assert on the issued token rather than a read-back), or the store behaviour needs a decision. Per the contributing rules, fix the cause or remove the test rather than retrying it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions