logging: deflake log deletion
Don't fail the LogsAndDelete test if Delete returns NotFound.
@@ -472,11 +472,16 @@ func TestLogsAndDelete(t *testing.T) {
}
if strings.HasPrefix(logID, testLogIDPrefix) {
if err := aclient.DeleteLog(ctx, logID); err != nil {
+ // Ignore NotFound. Sometimes, amazingly, DeleteLog cannot find
+ // a log that is returned by Logs.
+ if status.Code(err) != codes.NotFound {
t.Fatalf("deleting %q: %v", logID, err)
}
+ } else {
nDeleted++
}
}
+ }
t.Logf("deleted %d logs", nDeleted)
}
