cantaloupe-project / cantaloupe

High-performance dynamic image server in Java
https://cantaloupe-project.github.io/
Other
266 stars 107 forks source link

S3CacheTest.testPurge:330 is a flaky test #678

Closed jcoyne closed 2 days ago

jcoyne commented 1 month ago

This test seems to fail randomly on CI:

cantaloupe_1  | [ERROR]   S3CacheTest.testPurge:330 expected: <false> but was: <true>
DiegoPino commented 1 month ago

@jcoyne yes, it might be that these S3 tests can't act on Cache being written or now, so it waits 1/2 of the upload time only. If the backend is slow it might not be enough. Wonder if we could use Mockito in the future (no backed - just mocking the classes) (but requires probably a lot of rewriting) or this helper library to help with actually waiting? https://github.com/awaitility/awaitility

For Mockito: e.g https://github.com/aws/aws-sdk-java-v2/issues/3368 (the example test there is almost good, see comment of AWS folks down there)

glenrobson commented 1 month ago

Glen to have a look to see if testPurge is using the async.