Skip to content

[9.0] [Test] Fix FileSettingsRoleMappingsRestartIT (#129618) #129910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: 9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@ tests:
- class: org.elasticsearch.packaging.test.DockerTests
method: test140CgroupOsStatsAreAvailable
issue: https://github.com/elastic/elasticsearch/issues/120914
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
method: testReservedStatePersistsOnRestart
issue: https://github.com/elastic/elasticsearch/issues/120923
- class: org.elasticsearch.packaging.test.DockerTests
method: test070BindMountCustomPathConfAndJvmOptions
issue: https://github.com/elastic/elasticsearch/issues/120910
Expand All @@ -191,9 +188,6 @@ tests:
- class: org.elasticsearch.xpack.shutdown.AllocationFailuresResetOnShutdownIT
method: testResetAllocationFailuresOnNodeShutdown
issue: https://github.com/elastic/elasticsearch/issues/121129
- class: org.elasticsearch.xpack.security.FileSettingsRoleMappingsRestartIT
method: testFileSettingsReprocessedOnRestartWithoutVersionChange
issue: https://github.com/elastic/elasticsearch/issues/120964
- class: org.elasticsearch.xpack.ml.integration.PyTorchModelIT
issue: https://github.com/elastic/elasticsearch/issues/121165
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
Expand Down Expand Up @@ -329,4 +323,4 @@ tests:
# issue: "https://github.com/elastic/elasticsearch/..."
# - class: "org.elasticsearch.xpack.esql.**"
# method: "test {union_types.MultiIndexIpStringStatsInline *}"
# issue: "https://github.com/elastic/elasticsearch/..."
# issue: "https://github.com/elastic/elasticsearch/..."
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.apache.lucene.tests.util.LuceneTestCase;
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.common.Priority;
import org.elasticsearch.core.Tuple;
import org.elasticsearch.integration.RoleMappingFileSettingsIT;
import org.elasticsearch.reservedstate.service.FileSettingsService;
Expand Down Expand Up @@ -112,7 +113,8 @@ public void resetVersion() {
public void testReservedStatePersistsOnRestart() throws Exception {
internalCluster().setBootstrapMasterNodeIndex(0);

final String masterNode = internalCluster().getMasterName();
final String masterNode = internalCluster().startMasterOnlyNode();
awaitMasterNode();
var savedClusterState = setupClusterStateListener(masterNode, "everyone_kibana_alone");

awaitFileSettingsWatcher();
Expand Down Expand Up @@ -192,7 +194,8 @@ public void testReservedStatePersistsOnRestart() throws Exception {
public void testFileSettingsReprocessedOnRestartWithoutVersionChange() throws Exception {
internalCluster().setBootstrapMasterNodeIndex(0);

final String masterNode = internalCluster().getMasterName();
final String masterNode = internalCluster().startMasterOnlyNode();
awaitMasterNode();

Tuple<CountDownLatch, AtomicLong> savedClusterState = setupClusterStateListener(masterNode, "everyone_kibana_alone");
awaitFileSettingsWatcher();
Expand Down Expand Up @@ -316,4 +319,8 @@ private void awaitFileSettingsWatcher() throws Exception {
FileSettingsService masterFileSettingsService = internalCluster().getInstance(FileSettingsService.class, masterNode);
assertBusy(() -> assertTrue(masterFileSettingsService.watching()));
}

public void awaitMasterNode() {
clusterAdmin().prepareHealth(TEST_REQUEST_TIMEOUT).setTimeout(TEST_REQUEST_TIMEOUT).setWaitForEvents(Priority.LANGUID).get();
}
}