fix(sync): remove retry workaround now that root cause is fixed

The previous retry loop (added as a workaround) is no longer needed
since removing PollInterval prevents the periodic sync from starting
and creating the race condition. Also remove the now-unused syscall import.

Agent-Logs-Url: https://github.com/project-zot/zot/sessions/1a321663-3147-46e9-9321-989e5dd0ed3c

Co-authored-by: rchincha <45800463+rchincha@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-19 02:01:56 +00:00
committed by GitHub
parent 569afcc887
commit 4372a3faca
+1 -17
View File
@@ -17,7 +17,6 @@ import (
"reflect"
"strconv"
"strings"
"syscall"
goSync "sync"
"testing"
"time"
@@ -1548,22 +1547,7 @@ func TestDockerImagesAreSkipped(t *testing.T) {
// trigger config blob upstream error
// remove synced image
const (
maxRemoveRetries = 5
removeRetryDelay = 100 * time.Millisecond
)
downstreamImagePath := path.Join(destDir, testImage)
for retry := 0; retry < maxRemoveRetries; retry++ {
err = os.RemoveAll(downstreamImagePath)
if err == nil || !errors.Is(err, syscall.ENOTEMPTY) {
break
}
time.Sleep(removeRetryDelay)
}
err = os.RemoveAll(path.Join(destDir, testImage))
So(err, ShouldBeNil)
configBlobPath := path.Join(srcDir, testImage, "blobs/sha256", configBlobDigest.Encoded())