Skip to content

Properly fix data stream retrieval in TimeSeriesDataStreamsIT #125815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.WarningFailureException;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.Template;
Expand Down Expand Up @@ -82,8 +83,18 @@ public void testRolloverAction() throws Exception {
assertBusy(() -> {
final var backingIndices = getDataStreamBackingIndexNames(dataStream);
assertEquals(2, backingIndices.size());
assertTrue(Boolean.parseBoolean((String) getIndexSettingsAsMap(backingIndices.getLast()).get("index.hidden")));
assertEquals(PhaseCompleteStep.finalStep("hot").getKey(), getStepKeyForIndex(client(), backingIndices.getFirst()));
try {
assertTrue(Boolean.parseBoolean((String) getIndexSettingsAsMap(backingIndices.getLast()).get("index.hidden")));
assertEquals(PhaseCompleteStep.finalStep("hot").getKey(), getStepKeyForIndex(client(), backingIndices.getFirst()));
} catch (ResponseException e) {
// These API calls may hit different nodes and they might see slightly different versions of the cluster state,
// potentially resulting in a 404 which means we just need to try again.
if (e.getResponse().getStatusLine().getStatusCode() == 404) {
fail(e);
} else {
throw e;
}
}
});
}

Expand Down