Skip to content

Commit

Permalink
fix test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed Sep 19, 2024
1 parent dd2b705 commit a6c5ff7
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,14 @@ protected static void wipeDataStreams() throws IOException {
// We hit a version of ES that doesn't serialize DeleteDataStreamAction.Request#wildcardExpressionsOriginallySpecified field
// or that doesn't support data streams so it's safe to ignore
int statusCode = ee.getResponse().getStatusLine().getStatusCode();
if (statusCode < 404 || statusCode > 405) {
if (statusCode == 400) {
// the test cluster likely does not include the data streams module so we can ignore this error code
// additionally there is an implementation gotcha that cause response code to be 400 or 405 dependent on if
// "_data_stream/*" matches a registered index pattern such as {a}/{b} but not for the HTTP verb.
// Prior to v9 POST {index}/{type} was registered as a compatible index pattern so the request would partially match
// and return a 405, but without that pattern registered at all the return value is a 400.
return;
} else if (statusCode < 404 || statusCode > 405) {
throw ee;
}
}
Expand Down

0 comments on commit a6c5ff7

Please sign in to comment.