diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java index 4b7c25f28f9bd..2ff8f465af156 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java @@ -451,6 +451,10 @@ private void run(String jobId, CheckedRunnable disrupt) throws Except // else. persistentTasksClusterService.setRecheckInterval(TimeValue.timeValueMillis(200)); + // The timeout here was increased from 10 seconds to 20 seconds in response to the changes in + // https://github.com/elastic/elasticsearch/pull/50907 - now that the cluster state is stored + // in a Lucene index it can take a while to update when there are many updates in quick + // succession, like we see in internal cluster tests of node failure scenarios assertBusy(() -> { ClusterState clusterState = client().admin().cluster().prepareState().get().getState(); PersistentTasksCustomMetaData tasks = clusterState.metaData().custom(PersistentTasksCustomMetaData.TYPE); @@ -471,7 +475,7 @@ private void run(String jobId, CheckedRunnable disrupt) throws Except .getResponse().results().get(0); assertEquals(DatafeedState.STARTED, datafeedStats.getDatafeedState()); assertNotNull(datafeedStats.getNode()); - }); + }, 20, TimeUnit.SECONDS); long numDocs2 = randomIntBetween(2, 64); long now2 = System.currentTimeMillis();