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

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

Issue 2613893003: Gardening: improve debug output in standalone/io/socket_ipv6_test.dart. (Closed)
Patch Set: Created 3 years, 11 months 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
« no previous file with comments | « tests/standalone/io/socket_ipv6_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/test_utils.dart
diff --git a/tests/standalone/io/test_utils.dart b/tests/standalone/io/test_utils.dart
index c8bf0cef0efb9538bebd3d566756e32997a341f3..ace66035c4f3129ac8c1c4ebe440d4d773d41908 100644
--- a/tests/standalone/io/test_utils.dart
+++ b/tests/standalone/io/test_utils.dart
@@ -13,15 +13,21 @@ Future<int> freeIPv4AndIPv6Port() async {
return port;
}
+int lastRetryId = 0;
+
Future retry(Future fun(), {int maxCount: 10}) async {
+ final int id = lastRetryId++;
for (int i = 0; i < maxCount; i++) {
try {
// If there is no exception this will simply return, otherwise we keep
// trying.
return await fun();
- } catch (_) {}
- print("Failed to execute test closure in attempt $i "
- "(${maxCount - i} retries left).");
+ } catch (e, stack) {
+ print("Failed to execute test closure (retry id: ${id}) in attempt $i "
+ "(${maxCount - i} retries left).");
+ print("Exception: ${e}");
+ print("Stacktrace: ${stack}");
+ }
}
return await fun();
}
« no previous file with comments | « 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