From 511ebaed0e9b5025358a02b70b735d09a8dfcfde Mon Sep 17 00:00:00 2001 From: Ole-Martin Bratteng <1681525+omBratteng@users.noreply.github.com> Date: Sat, 23 Oct 2021 23:28:33 +0200 Subject: [PATCH] s3store: relax test to prevent failure from race conditions (#529) * fix: if a race condition occur, we check for it in the test * fix: windows sometimes only has 1 file * Trigger test runs * Trigger test runs * Trigger test runs * Trigger test runs * Trigger test runs --- pkg/s3store/s3store_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/s3store/s3store_test.go b/pkg/s3store/s3store_test.go index 88ec09a..caef100 100644 --- a/pkg/s3store/s3store_test.go +++ b/pkg/s3store/s3store_test.go @@ -1275,7 +1275,8 @@ func (s s3APIWithTempFileAssertion) UploadPartWithContext(context.Context, *s3.U for _, file := range files { assert.True(strings.HasPrefix(file.Name(), "tusd-s3-tmp-")) } - assert.Equal(len(files), 2) + assert.GreaterOrEqual(len(files), 1) + assert.LessOrEqual(len(files), 3) return nil, fmt.Errorf("not now") }