Skip to content

Commit

Permalink
systemtest: retry deleting ILM policy (#4186) (#4189)
Browse files Browse the repository at this point in the history
  • Loading branch information
axw authored Sep 14, 2020
1 parent e52c3c0 commit 535ee57
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions systemtest/elasticsearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ func CleanupElasticsearch(t testing.TB) {
}

// Delete the ILM policy last or we'll get an error due to it being in use.
err := doReq(esapi.ILMDeleteLifecycleRequest{Policy: "apm-rollover-30-days"})
if err != nil {
t.Fatal(err)
for {
err := doReq(esapi.ILMDeleteLifecycleRequest{Policy: "apm-rollover-30-days"})
if err == nil {
break
}
// Retry deleting, in case indices are still being deleted.
time.Sleep(100 * time.Millisecond)
}
}

Expand Down

0 comments on commit 535ee57

Please sign in to comment.