Skip to content

Commit d11c3b5

Browse files
Disable queryable built-in roles feature for core and datastream YAML tests (#121541) (#121664)
This PR disables the "queryable built-in roles" feature for the `CoreWithSecurityClientYamlTestSuiteIT` and `DataStreamsClientYamlTestSuiteIT` YAML test suites. The feature was enabled by default in the #120323 PR, which asynchronously creates the `.security` index after cluster formation and indexes all built-in roles. The asynchronous creation of the `.security` index introduces non-deterministic behavior in our YAML tests. Since these test suites are not intended to verify the queryable built-in roles functionality, having the feature enabled introduced flakiness and unnecessary complexity to handle `.security` in existing tests. These tests would have to exclude the `.security` index in some way (by adjusting permissions or API calls), and in the end cleanup (delete) the `.security` index. This simply adds overhead without much gain. The feature is already test covered by `XPackRestIT` and other integration/REST tests, disabling it here would not compromise test coverage. Instead, it ensures these suites remain deterministic and focused on the behaviors they were designed to verify. Resolves #121536 Resolves #121513 Resolves #121484 Resolves #121478 Resolves #121290 Resolves #121246 Resolves #121242 Resolves #121238 Resolves #121186 Resolves #121131 Resolves #121130 Resolves #121128 Resolves #121014 Resolves #120965 Resolves #120920 Resolves #120890 (cherry picked from commit d1beb01) # Conflicts: # muted-tests.yml
1 parent 7075357 commit d11c3b5

File tree

5 files changed

+4
-17
lines changed

5 files changed

+4
-17
lines changed

modules/data-streams/src/yamlRestTest/java/org/elasticsearch/datastreams/DataStreamsClientYamlTestSuiteIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ private static ElasticsearchCluster createCluster() {
4949
.feature(FAILURE_STORE_ENABLED)
5050
.setting("xpack.security.enabled", "true")
5151
.keystore("bootstrap.password", "x-pack-test-password")
52-
.user("x_pack_rest_user", "x-pack-test-password");
52+
.user("x_pack_rest_user", "x-pack-test-password")
53+
.systemProperty("es.queryable_built_in_roles_enabled", "false");
5354
if (initTestSeed().nextBoolean()) {
5455
clusterBuilder.setting("xpack.license.self_generated.type", "trial");
5556
}

muted-tests.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,6 @@ tests:
444444
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
445445
method: testFileSettingsReprocessedOnRestartWithoutVersionChange
446446
issue: https://github.com/elastic/elasticsearch/issues/120964
447-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
448-
method: test {p0=data_stream/80_resolve_index_data_streams/Resolve index with hidden and closed indices}
449-
issue: https://github.com/elastic/elasticsearch/issues/120965
450447
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
451448
method: test {p0=snapshot/20_operator_privileges_disabled/Operator only settings can be set and restored by non-operator user when operator privileges is disabled}
452449
issue: https://github.com/elastic/elasticsearch/issues/120973
@@ -464,21 +461,12 @@ tests:
464461
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
465462
method: testReservedStatePersistsOnRestart
466463
issue: https://github.com/elastic/elasticsearch/issues/120923
467-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
468-
method: test {p0=data_stream/140_data_stream_aliases/Create data stream alias}
469-
issue: https://github.com/elastic/elasticsearch/issues/120920
470464
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
471465
method: testSuggestProfilesWithHint
472466
issue: https://github.com/elastic/elasticsearch/issues/121116
473467
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
474468
method: test {p0=synonyms/110_synonyms_invalid/Reload index with an invalid synonym rule with lenient set to false}
475469
issue: https://github.com/elastic/elasticsearch/issues/121117
476-
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
477-
method: test {yaml=cat.aliases/40_hidden/Test cat aliases output with a visible index with a hidden alias}
478-
issue: https://github.com/elastic/elasticsearch/issues/121128
479-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
480-
method: test {p0=data_stream/140_data_stream_aliases/Create data stream aliases using wildcard expression}
481-
issue: https://github.com/elastic/elasticsearch/issues/120890
482470
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
483471
issue: https://github.com/elastic/elasticsearch/issues/121143
484472
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
@@ -489,9 +477,6 @@ tests:
489477
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
490478
method: testClientSecretRotation
491479
issue: https://github.com/elastic/elasticsearch/issues/120985
492-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
493-
method: test {p0=data_stream/140_data_stream_aliases/Create data stream alias with filter}
494-
issue: https://github.com/elastic/elasticsearch/issues/121014
495480
- class: org.elasticsearch.xpack.transform.integration.TransformAuditorIT
496481
method: testAuditorWritesAudits
497482
issue: https://github.com/elastic/elasticsearch/issues/121241

x-pack/plugin/ml/qa/ml-with-security/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,5 @@ testClusters.configureEach {
258258
user username: "no_ml", password: "x-pack-test-password", role: "minimal"
259259
setting 'xpack.license.self_generated.type', 'trial'
260260
setting 'xpack.security.enabled', 'true'
261+
systemProperty 'es.queryable_built_in_roles_enabled', 'false'
261262
}

x-pack/qa/core-rest-tests-with-security/src/yamlRestTest/java/org/elasticsearch/xpack/security/CoreWithSecurityClientYamlTestSuiteIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public class CoreWithSecurityClientYamlTestSuiteIT extends ESClientYamlSuiteTest
4646
.setting("xpack.ml.enabled", "false")
4747
.setting("xpack.license.self_generated.type", "trial")
4848
.setting("xpack.security.autoconfiguration.enabled", "false")
49+
.systemProperty("es.queryable_built_in_roles_enabled", "false")
4950
.user(USER, PASS)
5051
.feature(FeatureFlag.TIME_SERIES_MODE)
5152
.feature(FeatureFlag.SUB_OBJECTS_AUTO_ENABLED)

x-pack/qa/rolling-upgrade/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
4141
testDistribution = "DEFAULT"
4242
versions = [oldVersion, project.version]
4343
numberOfNodes = 3
44-
systemProperty 'es.queryable_built_in_roles_enabled', 'true'
4544
systemProperty 'ingest.geoip.downloader.enabled.default', 'true'
4645
//we don't want to hit real service from each test
4746
systemProperty 'ingest.geoip.downloader.endpoint.default', 'http://invalid.endpoint'

0 commit comments

Comments
 (0)