Skip to content

Commit 0a35430

Browse files
[Test] Fix SearchRequestCacheDisablingInterceptorTests (#114828) (#115137)
The #113501 PR introduced a change where `:index-name` is no longer considered a valid remote index name. The valid remote index name has to have a non-empty remote cluster name, e.g. `my-remote-cluster:index-name`. This PR changes tests to avoid randomly generating empty remote cluster names. Resolves #113659, #113660 (cherry picked from commit be22d2a) # Conflicts: # muted-tests.yml
1 parent 396e45f commit 0a35430

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

muted-tests.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,6 @@ tests:
275275
- class: org.elasticsearch.xpack.ml.integration.MlJobIT
276276
method: testGetJobs_GivenSingleJob
277277
issue: https://github.com/elastic/elasticsearch/issues/113655
278-
- class: org.elasticsearch.xpack.security.authz.interceptor.SearchRequestCacheDisablingInterceptorTests
279-
method: testHasRemoteIndices
280-
issue: https://github.com/elastic/elasticsearch/issues/113660
281-
- class: org.elasticsearch.xpack.security.authz.interceptor.SearchRequestCacheDisablingInterceptorTests
282-
method: testRequestCacheWillBeDisabledWhenSearchRemoteIndices
283-
issue: https://github.com/elastic/elasticsearch/issues/113659
284278
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
285279
method: test {p0=range/20_synthetic_source/Date range}
286280
issue: https://github.com/elastic/elasticsearch/issues/113874
@@ -425,4 +419,4 @@ tests:
425419
# issue: "https://github.com/elastic/elasticsearch/..."
426420
# - class: "org.elasticsearch.xpack.esql.**"
427421
# method: "test {union_types.MultiIndexIpStringStatsInline *}"
428-
# issue: "https://github.com/elastic/elasticsearch/..."
422+
# issue: "https://github.com/elastic/elasticsearch/..."

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void testRequestCacheWillBeDisabledWhenSearchRemoteIndices() {
9191
0,
9292
3,
9393
String[]::new,
94-
() -> randomAlphaOfLengthBetween(0, 5) + ":" + randomAlphaOfLengthBetween(3, 8)
94+
() -> randomAlphaOfLengthBetween(1, 5) + ":" + randomAlphaOfLengthBetween(3, 8)
9595
);
9696
final ArrayList<String> allIndices = Arrays.stream(ArrayUtils.concat(localIndices, remoteIndices))
9797
.collect(Collectors.toCollection(ArrayList::new));
@@ -121,7 +121,7 @@ public void testHasRemoteIndices() {
121121
0,
122122
3,
123123
String[]::new,
124-
() -> randomAlphaOfLengthBetween(0, 5) + ":" + randomAlphaOfLengthBetween(3, 8)
124+
() -> randomAlphaOfLengthBetween(1, 5) + ":" + randomAlphaOfLengthBetween(3, 8)
125125
);
126126
final ArrayList<String> allIndices = Arrays.stream(ArrayUtils.concat(localIndices, remoteIndices))
127127
.collect(Collectors.toCollection(ArrayList::new));

0 commit comments

Comments
 (0)