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

Unified Diff: tools/testing/dart/browser_controller.dart

Issue 442673003: Test infrastructure: Avoid restarting browser app on Android twice simultaneously. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use status.timeout instead. Created 6 years, 4 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: tools/testing/dart/browser_controller.dart
diff --git a/tools/testing/dart/browser_controller.dart b/tools/testing/dart/browser_controller.dart
index fbe6c106ad5d42c3fe1fedbd568468355ee4494e..e0784cf79a0f076a1ead79d10978aea249c685ec 100644
--- a/tools/testing/dart/browser_controller.dart
+++ b/tools/testing/dart/browser_controller.dart
@@ -998,6 +998,11 @@ class BrowserTestRunner {
void handleTimeout(BrowserTestingStatus status) {
// We simply kill the browser and starts up a new one!
// We could be smarter here, but it does not seems like it is worth it.
+ if (status.timeout) {
+ DebugLogger.error(
+ "Got test timeout for an already restarting browser");
+ return;
+ }
status.timeout = true;
timedOut.add(status.currentTest.url);
var id = status.browser.id;
@@ -1094,6 +1099,8 @@ class BrowserTestRunner {
browserName == 'DartiumOnAndroid' ) &&
status.timeSinceRestart.elapsed > RESTART_BROWSER_INTERVAL) {
var id = status.browser.id;
+ // Reset stopwatch so we don't trigger again before restarting.
+ status.timeout = true;
status.browser.close().then((_) {
// We don't want to start a new browser if we are terminating.
if (underTermination) return;
@@ -1143,12 +1150,14 @@ class BrowserTestRunner {
void handleNextTestTimeout(status) {
DebugLogger.warning(
"Browser timed out before getting next test. Restarting");
+ if (status.timeout) return;
numBrowserGetTestTimeouts++;
if (numBrowserGetTestTimeouts >= MAX_NEXT_TEST_TIMEOUTS) {
DebugLogger.error(
"Too many browser timeouts before getting next test. Terminating");
terminate().then((_) => exit(1));
} else {
+ status.timeout = true;
status.browser.close().then((_) => restartBrowser(status.browser.id));
}
}
« 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