Skip to content

Commit f243ff3

Browse files
committed
[ML] Increase assertBusy timeout in ML node failure tests (#52425)
Following the change to store cluster state in Lucene indices (#50907) it can take longer for all the cluster state updates associated with node failure scenarios to be processed during internal cluster tests where several nodes all run in the same JVM.
1 parent 0563065 commit f243ff3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/MlDistributedFailureIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ private void run(String jobId, CheckedRunnable<Exception> disrupt) throws Except
449449
// else.
450450
persistentTasksClusterService.setRecheckInterval(TimeValue.timeValueMillis(200));
451451

452+
// The timeout here was increased from 10 seconds to 20 seconds in response to the changes in
453+
// https://github.com/elastic/elasticsearch/pull/50907 - now that the cluster state is stored
454+
// in a Lucene index it can take a while to update when there are many updates in quick
455+
// succession, like we see in internal cluster tests of node failure scenarios
452456
assertBusy(() -> {
453457
ClusterState clusterState = client().admin().cluster().prepareState().get().getState();
454458
PersistentTasksCustomMetaData tasks = clusterState.metaData().custom(PersistentTasksCustomMetaData.TYPE);
@@ -469,7 +473,7 @@ private void run(String jobId, CheckedRunnable<Exception> disrupt) throws Except
469473
.getResponse().results().get(0);
470474
assertEquals(DatafeedState.STARTED, datafeedStats.getDatafeedState());
471475
assertNotNull(datafeedStats.getNode());
472-
});
476+
}, 20, TimeUnit.SECONDS);
473477

474478
long numDocs2 = randomIntBetween(2, 64);
475479
long now2 = System.currentTimeMillis();

0 commit comments

Comments
 (0)