summaryrefslogtreecommitdiff
path: root/workhorse/internal/artifacts/artifacts_store_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'workhorse/internal/artifacts/artifacts_store_test.go')
-rw-r--r--workhorse/internal/artifacts/artifacts_store_test.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/workhorse/internal/artifacts/artifacts_store_test.go b/workhorse/internal/artifacts/artifacts_store_test.go
index a01a723298f..f9fb28cf7ce 100644
--- a/workhorse/internal/artifacts/artifacts_store_test.go
+++ b/workhorse/internal/artifacts/artifacts_store_test.go
@@ -284,12 +284,9 @@ func TestUploadHandlerMultipartUploadSizeLimit(t *testing.T) {
contentBuffer, contentType := createTestMultipartForm(t, make([]byte, uploadSize))
response := testUploadArtifacts(t, contentType, ts.URL+Path, &contentBuffer)
require.Equal(t, http.StatusRequestEntityTooLarge, response.Code)
-
- // Poll because AbortMultipartUpload is async
- for i := 0; os.IsMultipartUpload(test.ObjectPath) && i < 100; i++ {
- time.Sleep(10 * time.Millisecond)
- }
- require.False(t, os.IsMultipartUpload(test.ObjectPath), "MultipartUpload should not be in progress anymore")
+ require.Eventually(t, func() bool {
+ return !os.IsMultipartUpload(test.ObjectPath)
+ }, time.Second, time.Millisecond, "MultipartUpload should not be in progress anymore")
require.Empty(t, os.GetObjectMD5(test.ObjectPath), "upload should have failed, so the object should not exists")
}