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
This commit is contained in:
Ole-Martin Bratteng 2021-10-23 23:28:33 +02:00 committed by GitHub
parent d1e710d065
commit 511ebaed0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1275,7 +1275,8 @@ func (s s3APIWithTempFileAssertion) UploadPartWithContext(context.Context, *s3.U
for _, file := range files { for _, file := range files {
assert.True(strings.HasPrefix(file.Name(), "tusd-s3-tmp-")) 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") return nil, fmt.Errorf("not now")
} }