Skip to content

Commit 9ca2890

Browse files
Disable queryable built-in roles feature for core and datastream YAML tests (#121541) (#121658)
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 e20fded commit 9ca2890

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
@@ -432,9 +432,6 @@ tests:
432432
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
433433
method: testFileSettingsReprocessedOnRestartWithoutVersionChange
434434
issue: https://github.com/elastic/elasticsearch/issues/120964
435-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
436-
method: test {p0=data_stream/80_resolve_index_data_streams/Resolve index with hidden and closed indices}
437-
issue: https://github.com/elastic/elasticsearch/issues/120965
438435
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
439436
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}
440437
issue: https://github.com/elastic/elasticsearch/issues/120973
@@ -452,21 +449,12 @@ tests:
452449
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
453450
method: testReservedStatePersistsOnRestart
454451
issue: https://github.com/elastic/elasticsearch/issues/120923
455-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
456-
method: test {p0=data_stream/140_data_stream_aliases/Create data stream alias}
457-
issue: https://github.com/elastic/elasticsearch/issues/120920
458452
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
459453
method: testSuggestProfilesWithHint
460454
issue: https://github.com/elastic/elasticsearch/issues/121116
461455
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
462456
method: test {p0=synonyms/110_synonyms_invalid/Reload index with an invalid synonym rule with lenient set to false}
463457
issue: https://github.com/elastic/elasticsearch/issues/121117
464-
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
465-
method: test {yaml=cat.aliases/40_hidden/Test cat aliases output with a visible index with a hidden alias}
466-
issue: https://github.com/elastic/elasticsearch/issues/121128
467-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
468-
method: test {p0=data_stream/140_data_stream_aliases/Create data stream aliases using wildcard expression}
469-
issue: https://github.com/elastic/elasticsearch/issues/120890
470458
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
471459
method: testActivateProfile
472460
issue: https://github.com/elastic/elasticsearch/issues/121151
@@ -475,9 +463,6 @@ tests:
475463
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
476464
method: testClientSecretRotation
477465
issue: https://github.com/elastic/elasticsearch/issues/120985
478-
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
479-
method: test {p0=data_stream/140_data_stream_aliases/Create data stream alias with filter}
480-
issue: https://github.com/elastic/elasticsearch/issues/121014
481466
- class: org.elasticsearch.xpack.transform.integration.TransformAuditorIT
482467
method: testAuditorWritesAudits
483468
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)