diff --git a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/DownsampleActionIT.java b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/DownsampleActionIT.java index 2e61b6e978b61..c44c15f7e9949 100644 --- a/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/DownsampleActionIT.java +++ b/x-pack/plugin/ilm/qa/multi-node/src/javaRestTest/java/org/elasticsearch/xpack/ilm/actions/DownsampleActionIT.java @@ -337,9 +337,6 @@ public void testTsdbDataStreams() throws Exception { rolloverMaxOneDocCondition(client(), dataStream); String rollupIndex = waitAndGetRollupIndexName(client(), backingIndexName, fixedInterval); - if (rollupIndex == null) { - logger.warn("explain:" + explainIndex(client(), backingIndexName)); - } assertNotNull(String.format(Locale.ROOT, "Cannot retrieve rollup index [%s]", rollupIndex), rollupIndex); assertBusy(() -> assertTrue("Rollup index does not exist", indexExists(rollupIndex)), 30, TimeUnit.SECONDS); assertBusy(() -> assertFalse("Source index should have been deleted", indexExists(backingIndexName)), 30, TimeUnit.SECONDS); @@ -605,7 +602,7 @@ public void testDownsampleTwiceSameInterval() throws Exception { * @return the name of the rollup index for a given index, null if none exist */ public String waitAndGetRollupIndexName(RestClient client, String originalIndexName, DateHistogramInterval fixedInterval) - throws InterruptedException { + throws InterruptedException, IOException { final String[] rollupIndexName = new String[1]; waitUntil(() -> { try { @@ -615,7 +612,15 @@ public String waitAndGetRollupIndexName(RestClient client, String originalIndexN return false; } }, 120, TimeUnit.SECONDS); // High timeout in case we're unlucky and end_time has been increased. - logger.info("--> original index name is [{}], rollup index name is [{}]", originalIndexName, rollupIndexName[0]); + if (rollupIndexName[0] == null) { + logger.warn( + "--> original index name is [{}], rollup index name is NULL, possible explanation: {}", + originalIndexName, + explainIndex(client(), originalIndexName) + ); + } else { + logger.info("--> original index name is [{}], rollup index name is [{}]", originalIndexName, rollupIndexName[0]); + } return rollupIndexName[0]; }