Skip to content

Commit a0e4f30

Browse files
[Test] Fix failing RBACEngineTests (#126106) (#126183)
Adjusting the test assertion to account for the potential 3rd extra group (#125900). Resolves #126061 (cherry picked from commit 7b753d0) # Conflicts: # muted-tests.yml
1 parent bf3fee4 commit a0e4f30

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

muted-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,4 +488,4 @@ tests:
488488
issue: https://github.com/elastic/elasticsearch/issues/125549
489489
- class: org.elasticsearch.xpack.application.ModelRegistryUpgradeIT
490490
method: testUpgradeModels {upgradedNodes=3}
491-
issue: https://github.com/elastic/elasticsearch/issues/125535
491+
issue: https://github.com/elastic/elasticsearch/issues/125535

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
@@ -1622,10 +1622,10 @@ public void testGetRoleDescriptorsIntersectionForRemoteClusterHasDeterministicOr
16221622
Set<IndexPrivilege> splitBySelector = IndexPrivilege.resolveBySelectorAccess(
16231623
Set.copyOf(randomSubsetOf(randomIntBetween(1, 4), IndexPrivilege.names()))
16241624
);
1625-
// 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
1626-
// final assertion
1627-
if (splitBySelector.size() == 2) {
1628-
extraGroups++;
1625+
// If we end up with failure and data access (or failure, data and failure and data access),
1626+
// we will split and end up with extra groups. Need to account for this for the final assertion
1627+
if (splitBySelector.size() >= 2) {
1628+
extraGroups += splitBySelector.size() - 1;
16291629
}
16301630
for (var privilege : splitBySelector) {
16311631
remoteIndicesBuilder.addGroup(

0 commit comments

Comments
 (0)