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

Unified Diff: tests/lib/async/stream_timeout_test.dart

Issue 137143014: Attempt to make stream-timeout test less flaky. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/stream_timeout_test.dart
diff --git a/tests/lib/async/stream_timeout_test.dart b/tests/lib/async/stream_timeout_test.dart
index ffd25d84d6ead5c3d4c73fd2d1e3ed0ae41646e0..80fe8114b3dcc16ef1ed429d460953745394a239 100644
--- a/tests/lib/async/stream_timeout_test.dart
+++ b/tests/lib/async/stream_timeout_test.dart
@@ -100,8 +100,10 @@ main() {
Stream tos = c.stream.timeout(halfSec, onTimeout: (_) {
int elapsed = sw.elapsedMilliseconds;
if (elapsed > 250) {
- // This should not happen.
+ // This should not happen, but it does occasionally.
+ // Starving the periodic timer has made the test useless.
print("Periodic timer of 5 ms delayed $elapsed ms.");
+ return;
}
fail("Timeout not prevented by events");
throw "ERROR";
@@ -125,8 +127,10 @@ main() {
Stream tos = c.stream.timeout(halfSec, onTimeout: (_) {
int elapsed = sw.elapsedMilliseconds;
if (elapsed > 250) {
- // This should not happen.
+ // This should not happen, but it does occasionally.
+ // Starving the periodic timer has made the test useless.
print("Periodic timer of 5 ms delayed $elapsed ms.");
+ return;
}
fail("Timeout not prevented by errors");
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698