| Index: tests/standalone/io/test_utils.dart
|
| diff --git a/tests/standalone/io/test_utils.dart b/tests/standalone/io/test_utils.dart
|
| index 2dbaf977e4033d0d8fb66c40086e49f6d357bc2f..f1bd08062c3db6906536b53c8ceefe4d37c53b23 100644
|
| --- a/tests/standalone/io/test_utils.dart
|
| +++ b/tests/standalone/io/test_utils.dart
|
| @@ -26,3 +26,17 @@ Future retry(Future fun(), {int maxCount: 10}) async {
|
| return await fun();
|
| }
|
|
|
| +
|
| +retrySync(fun, {int maxCount: 10}) {
|
| + for (int i = 0; i < maxCount; i++) {
|
| + try {
|
| + // If there is no exception this will simply return, otherwise we keep
|
| + // trying.
|
| + return fun();
|
| + } catch (_) {}
|
| + print("Failed to execute test closure in attempt $i "
|
| + "(${maxCount - i} retries left).");
|
| + }
|
| + return fun();
|
| +}
|
| +
|
|
|