Ensure tests clear AuthorizationServerContextHolder by rwinch · Pull Request #18768 · spring-projects/spring-security · GitHub
Skip to content

Ensure tests clear AuthorizationServerContextHolder#18768

Merged
rwinch merged 1 commit into
spring-projects:mainfrom
rwinch:clear-authorizationservercontextholder
Feb 19, 2026
Merged

Ensure tests clear AuthorizationServerContextHolder#18768
rwinch merged 1 commit into
spring-projects:mainfrom
rwinch:clear-authorizationservercontextholder

Conversation

@rwinch

@rwinch rwinch commented Feb 19, 2026

Copy link
Copy Markdown
Member

There are tests that do not clear AuthorizationServerContextHolder which causes flakey tests to happen. For example, this test occasionally fails:


OAuth2AuthorizationCodeRequestAuthenticationProviderTests > authenticateWhenAuthorizationCodeRequestWithRequestUriThenReturnAuthorizationCode() FAILED
    org.springframework.security.oauth2.server.authorization.authentication.OAuth2AuthorizationCodeRequestAuthenticationException at OAuth2AuthorizationCodeRequestAuthenticationProviderTests.java:629

@rwinch rwinch added this to the 7.0.4 milestone Feb 19, 2026
@rwinch rwinch self-assigned this Feb 19, 2026
@rwinch rwinch enabled auto-merge (rebase) February 19, 2026 21:09
@rwinch rwinch added in: build An issue in the build type: bug A general bug in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) labels Feb 19, 2026
@rwinch rwinch merged commit 0dc1aa1 into spring-projects:main Feb 19, 2026
7 checks passed
rwinch added a commit that referenced this pull request Feb 23, 2026
@rwinch rwinch deleted the clear-authorizationservercontextholder branch February 23, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: build An issue in the build in: oauth2 An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose) type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant