erlef / oidcc

OpenId Connect client library in Erlang & Elixir
https://hexdocs.pm/oidcc
Apache License 2.0
184 stars 49 forks source link

Flaky test: test &Oidcc.client_credentials_token/2 works (Oidcc.TokenTest) #389

Open dustinfarris opened 1 month ago

dustinfarris commented 1 month ago

oidcc version

b3bb1a9e31905ca52f372b963c968acd3b12c640

Erlang version

27.0.1

Elixir version

1.17.2

Summary

There is a flaky test.

Current behavior

occassionally this test fails

  1) test &Oidcc.client_credentials_token/2 works (Oidcc.TokenTest)
     test/oidcc/token_test.exs:211
     match (=) failed
     code:  assert {:ok, %Token{}} =
              Oidcc.Token.client_credentials(
                client_context,
                %{scope: ["openid"]}
              )
     left:  {:ok, %Oidcc.Token{}}
     right: {:error, :no_matching_key}
     stacktrace:
       test/oidcc/token_test.exs:224: (test)

How to reproduce

mix test

Expected behavior

all tests should pass

maennchen commented 2 weeks ago

The issues seem to be triggered when Zitadel does not have any keys in the jwks initially since not all tests perform key rotation on a new kid.