diff --git a/internal/backend/test/tests.go b/internal/backend/test/tests.go index c2e5d0fc0..c03db79e3 100644 --- a/internal/backend/test/tests.go +++ b/internal/backend/test/tests.go @@ -428,6 +428,11 @@ func (s *Suite[C]) TestListCancel(t *testing.T) { // wait until the context is cancelled <-ctxTimeout.Done() + // The cancellation of a context first closes the done channel of the context and + // _afterwards_ propagates the cancellation to child contexts. If the List + // implementation uses a child context, then it may take a moment until that context + // is also cancelled. Thus give the context cancellation a moment to propagate. + time.Sleep(time.Millisecond) return nil })