From f749723597de3be9206a693dc4a65af3ea7fa0ea Mon Sep 17 00:00:00 2001 From: Jaime Soriano Pastor Date: Thu, 4 Jul 2024 16:30:06 +0200 Subject: [PATCH] Ignore not found errors when deleting data streams (#1953) --- internal/testrunner/runners/system/tester.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/testrunner/runners/system/tester.go b/internal/testrunner/runners/system/tester.go index e1026ebee..2e3b217ae 100644 --- a/internal/testrunner/runners/system/tester.go +++ b/internal/testrunner/runners/system/tester.go @@ -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 }