Fix cleanup error on content client test

A race occurs today where the cleanup runs after the lease
has been deleted, making all the content and statuses
eligible for collection during the cleanup. There is a case
where a status could be listed but removed before the
abort is called. In this case, abort will return a not found
and the test cleanup should ignore it.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan 2019-11-26 11:22:35 -08:00
parent 75a46cec6a
commit 8da4346686
No known key found for this signature in database
GPG Key ID: F58C5D0A4405ACDB

View File

@ -57,7 +57,7 @@ func newContentStore(ctx context.Context, root string) (context.Context, content
return err
}
for _, st := range statuses {
if err := cs.Abort(ctx, st.Ref); err != nil {
if err := cs.Abort(ctx, st.Ref); err != nil && !errdefs.IsNotFound(err) {
return errors.Wrapf(err, "failed to abort %s", st.Ref)
}
}