Skip to content

Commit b382e2c

Browse files
authored
Fix race condition in JWT realm test (#138448)
Fix race condition in JwtRealmAuthenticateTests testJwkUpdatesByReloadWithFile. The foreground test thread checks the JWT cache without proper locking or synchronization. The can result in concurrent modification to the JWT cache and NPE. This change simply disables the JWT cache for this test. It isn't relevant to the test.
1 parent 39d634c commit b382e2c

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,6 @@ tests:
408408
- class: org.elasticsearch.xpack.ml.integration.RevertModelSnapshotIT
409409
method: testRevertModelSnapshot_DeleteInterveningResults
410410
issue: https://github.com/elastic/elasticsearch/issues/132349
411-
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmAuthenticateTests
412-
method: testJwkUpdatesByReloadWithFile
413-
issue: https://github.com/elastic/elasticsearch/issues/138397
414411
- class: org.elasticsearch.smoketest.MlWithSecurityIT
415412
method: test {yaml=ml/start_data_frame_analytics/Test start classification analysis when the dependent variable cardinality is too low}
416413
issue: https://github.com/elastic/elasticsearch/issues/138409

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/jwt/JwtRealmAuthenticateTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private void doTestJwkUpdatesByReload(boolean httpsServer) throws Exception {
286286
1, // audiencesRange
287287
1, // usersRange
288288
1, // rolesRange
289-
1, // jwtCacheSizeRange
289+
0, // jwtCacheSizeRange (disabled cache)
290290
httpsServer, // createHttpsServer,
291291
true
292292
);

0 commit comments

Comments
 (0)