From ea8475221481a5ffa5021059707367852f3e1c31 Mon Sep 17 00:00:00 2001 From: peusebiu Date: Wed, 21 Jun 2023 19:53:14 +0300 Subject: [PATCH] fix(test): fix flaky test (#1544) Signed-off-by: Petu Eusebiu --- pkg/extensions/sync/sync_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/extensions/sync/sync_test.go b/pkg/extensions/sync/sync_test.go index a2889eb4..1e8455d3 100644 --- a/pkg/extensions/sync/sync_test.go +++ b/pkg/extensions/sync/sync_test.go @@ -439,7 +439,6 @@ func TestORAS(t *testing.T) { So(err, ShouldBeNil) resp, err = resty.R().Get(getORASReferrersURL) - So(err, ShouldBeNil) So(resp, ShouldNotBeEmpty) So(resp.StatusCode(), ShouldEqual, http.StatusInternalServerError) @@ -451,6 +450,9 @@ func TestORAS(t *testing.T) { err = os.Chmod(path.Join(srcDir, testImage, "blobs/sha256", artifactDigest.Encoded()), 0o000) So(err, ShouldBeNil) + err = os.RemoveAll(path.Join(destDir, testImage)) + So(err, ShouldBeNil) + resp, err = resty.R().Get(destBaseURL + "/v2/" + testImage + "/manifests/" + digest.String()) So(err, ShouldBeNil) So(resp, ShouldNotBeEmpty)