mirror of
https://github.com/project-zot/zot.git
synced 2026-06-18 05:28:07 +08:00
test(sync): retry RemoveAll on ENOTEMPTY in flaky extension test
Agent-Logs-Url: https://github.com/project-zot/zot/sessions/a8131207-64f5-4461-962a-19aab205da7d Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4bc4261e84
commit
94d6a3e837
@@ -17,6 +17,7 @@ import (
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
goSync "sync"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -1550,7 +1551,17 @@ func TestDockerImagesAreSkipped(t *testing.T) {
|
||||
|
||||
// trigger config blob upstream error
|
||||
// remove synced image
|
||||
err = os.RemoveAll(path.Join(destDir, testImage))
|
||||
downstreamImagePath := path.Join(destDir, testImage)
|
||||
|
||||
for retry := 0; retry < 5; retry++ {
|
||||
err = os.RemoveAll(downstreamImagePath)
|
||||
if err == nil || !errors.Is(err, syscall.ENOTEMPTY) {
|
||||
break
|
||||
}
|
||||
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
}
|
||||
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
configBlobPath := path.Join(srcDir, testImage, "blobs/sha256", configBlobDigest.Encoded())
|
||||
|
||||
Reference in New Issue
Block a user