Skip to content

Commit

Permalink
DownsampleActionIT improve debugging (#103897) (#103900)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
martijnvg and elasticmachine authored Jan 4, 2024
1 parent e3e8c46 commit 2b6b82a
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand All @@ -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];
}

Expand Down

0 comments on commit 2b6b82a

Please sign in to comment.