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:
parent
75a46cec6a
commit
8da4346686
@ -57,7 +57,7 @@ func newContentStore(ctx context.Context, root string) (context.Context, content
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, st := range statuses {
|
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)
|
return errors.Wrapf(err, "failed to abort %s", st.Ref)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user