Uses test to decide whether each failure should retry.
test
const QueryRetry.when(bool Function(int failureCount, Object error) test) : _test = test;