fix(bigquery): add retries for table deletion
In
we observed sample tests failing due to ratelimit pushback on the
delete call.
This PR wraps the delete call in a retry, which should help
reduce the probability of this occuring.
@@ -610,9 +610,13 @@ func (t *Table) Delete(ctx context.Context) (err error) {
ctx = trace.StartSpan(ctx, "cloud.google.com/go/bigquery.Table.Delete")
defer func() { trace.EndSpan(ctx, err) }()
- req := t.c.bqs.Tables.Delete(t.ProjectID, t.DatasetID, t.TableID).Context(ctx)
- setClientHeader(req.Header())
- return req.Do()
+ call := t.c.bqs.Tables.Delete(t.ProjectID, t.DatasetID, t.TableID).Context(ctx)
+ setClientHeader(call.Header())
+
+ return runWithRetry(ctx, func() (err error) {
+ err = call.Do()
+ return err
+ })
}
// Read fetches the contents of the table.
