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

Unified Diff: lib/src/runner/browser/browser_manager.dart

Issue 1098703003: Add timeouts for browser connections. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 8 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 | lib/src/runner/browser/server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/browser/browser_manager.dart
diff --git a/lib/src/runner/browser/browser_manager.dart b/lib/src/runner/browser/browser_manager.dart
index a3f64a25894256e12e570f061a23155584bb9742..380be41f42be4b6db91ac492eb1c1e9cb2ab44da 100644
--- a/lib/src/runner/browser/browser_manager.dart
+++ b/lib/src/runner/browser/browser_manager.dart
@@ -56,7 +56,11 @@ class BrowserManager {
// The stream may close before emitting a value if the browser is killed
// prematurely (e.g. via Control-C).
- return maybeFirst(suiteChannel.stream).then((response) {
+ return maybeFirst(suiteChannel.stream)
+ .timeout(new Duration(seconds: 7), onTimeout: () {
+ throw new LoadException(
+ path, "Timed out waiting for the test suite to connect.");
+ }).then((response) {
if (response == null) return null;
if (response["type"] == "loadException") {
« no previous file with comments | « no previous file | lib/src/runner/browser/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698