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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 11649047: Add a timeout to scheduled pub tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« 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: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 78d198ae0da8e43644995f3f9511f2cfe4bf23e2..44290b02e5c01cb0021a2386468ca0adb714c018 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -509,6 +509,10 @@ List<_ScheduledEvent> _scheduledOnException;
*/
bool _abortScheduled = false;
+/// The time (in milliseconds) to wait for the entire scheduled test to
+/// complete.
+final _TIMEOUT = 30000;
+
/**
* Runs all the scheduled events for a test case. This should only be called
* once per test case.
@@ -549,9 +553,9 @@ void run() {
return true;
});
- future.chain((_) => cleanup()).then((_) {
- asyncDone();
- });
+ timeout(future, _TIMEOUT, 'waiting for a test to complete')
+ .chain((_) => cleanup())
+ .then((_) => asyncDone());
}
/// Get the path to the root "util/test/pub" directory containing the pub tests.
« 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