Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: tests/standalone/io/test_utils.dart

Issue 2566273007: Fix flaky timeouts of socket_ipv6_test. (Closed)
Patch Set: fix multi-test numbering Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
+}
+
« tests/standalone/io/socket_ipv6_test.dart ('K') | « tests/standalone/io/socket_ipv6_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698