Skip to content
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

Ignore not found errors when deleting data streams #1953

Merged
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
8 changes: 6 additions & 2 deletions internal/testrunner/runners/system/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,15 @@ func (r *tester) deleteDataStream(ctx context.Context, dataStream string) error
r.esAPI.Indices.DeleteDataStream.WithContext(ctx),
)
if err != nil {
return fmt.Errorf("failed to delete data stream %s: %w", dataStream, err)
return fmt.Errorf("delete request failed for data stream %s: %w", dataStream, err)
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusNotFound {
// Data stream doesn't exist, there was nothing to do.
return nil
}
if resp.IsError() {
return fmt.Errorf("could not get delete data stream %s: %s", dataStream, resp.String())
return fmt.Errorf("delete request failed for data stream %s: %s", dataStream, resp.String())
}
return nil
}
Expand Down