Skip to content

Fix flaky ObjectReader test

Sami Hiltunen requested to merge smh-fix-flaky-object-reader-test into master

TestCache_ObjectReader/uncacheable is asserting that the object reader is closed after the context provided in the constructor is canceled. The clean up happens in a goroutine that listens for context cancellation and is thus not synchronizable by the calling code. It would be better if the clean up calls were explicit and synchronous so the calling code could synchronize if it wanted to. That's a bigger change though, so for now, let's use require.Eventually in the test to fix the flakiness by retrying the condition until it succeeds.

Merge request reports