Skip to content

Commit 7b753d0

Browse files
[Test] Fix failing RBACEngineTests (#126106)
Adjusting the test assertion to account for the potential 3rd extra group (#125900). Resolves #126061
1 parent 04e25ad commit 7b753d0

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,6 @@ tests:
389389
- class: org.elasticsearch.action.RejectionActionIT
390390
method: testSimulatedSearchRejectionLoad
391391
issue: https://github.com/elastic/elasticsearch/issues/125901
392-
- class: org.elasticsearch.xpack.security.authz.RBACEngineTests
393-
method: testGetRoleDescriptorsIntersectionForRemoteClusterHasDeterministicOrderForIndicesPrivileges
394-
issue: https://github.com/elastic/elasticsearch/issues/126061
395392
- class: org.elasticsearch.search.CCSDuelIT
396393
method: testTerminateAfter
397394
issue: https://github.com/elastic/elasticsearch/issues/126085

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/RBACEngineTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,10 +1699,10 @@ public void testGetRoleDescriptorsIntersectionForRemoteClusterHasDeterministicOr
16991699
Set<IndexPrivilege> splitBySelector = IndexPrivilege.resolveBySelectorAccess(
17001700
Set.copyOf(randomSubsetOf(randomIntBetween(1, 4), IndexPrivilege.names()))
17011701
);
1702-
// If we end up with failure and data access, we will split and end up with extra groups. Need to account for this for the
1703-
// final assertion
1704-
if (splitBySelector.size() == 2) {
1705-
extraGroups++;
1702+
// If we end up with failure and data access (or failure, data and failure and data access),
1703+
// we will split and end up with extra groups. Need to account for this for the final assertion
1704+
if (splitBySelector.size() >= 2) {
1705+
extraGroups += splitBySelector.size() - 1;
17061706
}
17071707
for (var privilege : splitBySelector) {
17081708
remoteIndicesBuilder.addGroup(

0 commit comments

Comments
 (0)