diff --git a/muted-tests.yml b/muted-tests.yml index 33212b5652175..05971de88fa90 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -379,9 +379,6 @@ tests: - class: org.elasticsearch.xpack.search.AsyncSearchConcurrentStatusIT method: testConcurrentStatusFetchWhileTaskCloses issue: https://github.com/elastic/elasticsearch/issues/138543 -- class: org.elasticsearch.xpack.core.security.authc.AuthenticationTests - method: testMaybeRewriteForOlderVersionWithCrossClusterAccessRewritesAuthenticationInMetadata - issue: https://github.com/elastic/elasticsearch/issues/139167 - class: org.elasticsearch.smoketest.MlWithSecurityIT method: test {yaml=ml/sparse_vector_search/Test sparse_vector search with query vector and pruning config} issue: https://github.com/elastic/elasticsearch/issues/139196 diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java index 2085e38a12758..3498146270f99 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java @@ -874,7 +874,6 @@ public void testBwcWithStoredAuthenticationHeaders() throws IOException { } public void testMaybeRewriteForOlderVersionWithCrossClusterAccessRewritesAuthenticationInMetadata() throws IOException { - randomTransportVersion(Authentication.VERSION_CROSS_CLUSTER_ACCESS); final TransportVersion version = randomTransportVersion(Authentication.VERSION_CROSS_CLUSTER_ACCESS); final Authentication innerAuthentication = AuthenticationTestHelper.builder().transportVersion(version).build(); final Authentication authentication = AuthenticationTestHelper.builder() @@ -883,7 +882,9 @@ public void testMaybeRewriteForOlderVersionWithCrossClusterAccessRewritesAuthent new CrossClusterAccessSubjectInfo(innerAuthentication, RoleDescriptorsIntersection.EMPTY) ) .build(); - final TransportVersion maybeOldVersion = randomTransportVersion(Authentication.VERSION_CROSS_CLUSTER_ACCESS); + final TransportVersion maybeOldVersion = Authentication.VERSION_CROSS_CLUSTER_ACCESS == version + ? version + : randomTransportVersionBetween(Authentication.VERSION_CROSS_CLUSTER_ACCESS, version); final Authentication actual = authentication.maybeRewriteForOlderVersion(maybeOldVersion);