Skip to content

Commit

Permalink
Disable queryable built-in roles feature for core and datastream YAML…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
slobodanadamovic authored Feb 4, 2025
1 parent 7075357 commit d11c3b5
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ private static ElasticsearchCluster createCluster() {
.feature(FAILURE_STORE_ENABLED)
.setting("xpack.security.enabled", "true")
.keystore("bootstrap.password", "x-pack-test-password")
.user("x_pack_rest_user", "x-pack-test-password");
.user("x_pack_rest_user", "x-pack-test-password")
.systemProperty("es.queryable_built_in_roles_enabled", "false");
if (initTestSeed().nextBoolean()) {
clusterBuilder.setting("xpack.license.self_generated.type", "trial");
}
Expand Down
15 changes: 0 additions & 15 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -444,9 +444,6 @@ tests:
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
method: testFileSettingsReprocessedOnRestartWithoutVersionChange
issue: https://github.com/elastic/elasticsearch/issues/120964
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
method: test {p0=data_stream/80_resolve_index_data_streams/Resolve index with hidden and closed indices}
issue: https://github.com/elastic/elasticsearch/issues/120965
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
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}
issue: https://github.com/elastic/elasticsearch/issues/120973
Expand All @@ -464,21 +461,12 @@ tests:
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
method: testReservedStatePersistsOnRestart
issue: https://github.com/elastic/elasticsearch/issues/120923
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
method: test {p0=data_stream/140_data_stream_aliases/Create data stream alias}
issue: https://github.com/elastic/elasticsearch/issues/120920
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
method: testSuggestProfilesWithHint
issue: https://github.com/elastic/elasticsearch/issues/121116
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=synonyms/110_synonyms_invalid/Reload index with an invalid synonym rule with lenient set to false}
issue: https://github.com/elastic/elasticsearch/issues/121117
- class: org.elasticsearch.xpack.security.CoreWithSecurityClientYamlTestSuiteIT
method: test {yaml=cat.aliases/40_hidden/Test cat aliases output with a visible index with a hidden alias}
issue: https://github.com/elastic/elasticsearch/issues/121128
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
method: test {p0=data_stream/140_data_stream_aliases/Create data stream aliases using wildcard expression}
issue: https://github.com/elastic/elasticsearch/issues/120890
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryIT
issue: https://github.com/elastic/elasticsearch/issues/121143
- class: org.elasticsearch.xpack.security.profile.ProfileIntegTests
Expand All @@ -489,9 +477,6 @@ tests:
- class: org.elasticsearch.xpack.security.authc.jwt.JwtRealmSingleNodeTests
method: testClientSecretRotation
issue: https://github.com/elastic/elasticsearch/issues/120985
- class: org.elasticsearch.datastreams.DataStreamsClientYamlTestSuiteIT
method: test {p0=data_stream/140_data_stream_aliases/Create data stream alias with filter}
issue: https://github.com/elastic/elasticsearch/issues/121014
- class: org.elasticsearch.xpack.transform.integration.TransformAuditorIT
method: testAuditorWritesAudits
issue: https://github.com/elastic/elasticsearch/issues/121241
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/ml/qa/ml-with-security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,5 @@ testClusters.configureEach {
user username: "no_ml", password: "x-pack-test-password", role: "minimal"
setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.security.enabled', 'true'
systemProperty 'es.queryable_built_in_roles_enabled', 'false'
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class CoreWithSecurityClientYamlTestSuiteIT extends ESClientYamlSuiteTest
.setting("xpack.ml.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.setting("xpack.security.autoconfiguration.enabled", "false")
.systemProperty("es.queryable_built_in_roles_enabled", "false")
.user(USER, PASS)
.feature(FeatureFlag.TIME_SERIES_MODE)
.feature(FeatureFlag.SUB_OBJECTS_AUTO_ENABLED)
Expand Down
1 change: 0 additions & 1 deletion x-pack/qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ buildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
testDistribution = "DEFAULT"
versions = [oldVersion, project.version]
numberOfNodes = 3
systemProperty 'es.queryable_built_in_roles_enabled', 'true'
systemProperty 'ingest.geoip.downloader.enabled.default', 'true'
//we don't want to hit real service from each test
systemProperty 'ingest.geoip.downloader.endpoint.default', 'http://invalid.endpoint'
Expand Down

0 comments on commit d11c3b5

Please sign in to comment.