From 11a55d230709bd52c916df108310a618d127140d Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Tue, 18 Sep 2018 14:02:09 -0600 Subject: [PATCH] [TEST] Handle an IndexLifecycleService that has not started up --- .../indexlifecycle/IndexLifecycleInitialisationIT.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleInitialisationIT.java b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleInitialisationIT.java index fe8a5a59636..58df9ce8d46 100644 --- a/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleInitialisationIT.java +++ b/x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/indexlifecycle/IndexLifecycleInitialisationIT.java @@ -351,12 +351,15 @@ public class IndexLifecycleInitialisationIT extends ESIntegTestCase { }); } - public void testPollIntervalUpdate() { + public void testPollIntervalUpdate() throws Exception { TimeValue pollInterval = TimeValue.timeValueSeconds(randomLongBetween(1, 5)); final String server_1 = internalCluster().startMasterOnlyNode( Settings.builder().put(LifecycleSettings.LIFECYCLE_POLL_INTERVAL, pollInterval.getStringRep()).build()); IndexLifecycleService indexLifecycleService = internalCluster().getInstance(IndexLifecycleService.class, server_1); - assertThat(indexLifecycleService.getScheduler().jobCount(), equalTo(1)); + assertBusy(() -> { + assertNotNull(indexLifecycleService.getScheduler()); + assertThat(indexLifecycleService.getScheduler().jobCount(), equalTo(1)); + }); { TimeValueSchedule schedule = (TimeValueSchedule) indexLifecycleService.getScheduledJob().getSchedule(); assertThat(schedule.getInterval(), equalTo(pollInterval));