Skip to content

Commit 8da4346

Browse files
committed
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>
1 parent 75a46ce commit 8da4346

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func newContentStore(ctx context.Context, root string) (context.Context, content
5757
return err
5858
}
5959
for _, st := range statuses {
60-
if err := cs.Abort(ctx, st.Ref); err != nil {
60+
if err := cs.Abort(ctx, st.Ref); err != nil && !errdefs.IsNotFound(err) {
6161
return errors.Wrapf(err, "failed to abort %s", st.Ref)
6262
}
6363
}

0 commit comments

Comments
 (0)