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

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

Issue 10190005: Fix timeouts in standalone/io/TestRunnerTest by increasing timeout. Fix a few errors in test_runne… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix builds with only x64 architecture. Created 8 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 | « tests/standalone/src/io/TestRunnerTest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 2615303f8fe9a52d4ef85abf05666564610d772c..1eeb00e8268906b3b80c9393f8934e3f6068534e 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -506,6 +506,8 @@ class RunningProcess {
/** Which command of [testCase.commands] is currently being executed. */
int currentStep;
+ static final int kErrorStartingProcess = -171717; // Chosen arbitrarily.
+
RunningProcess(TestCase this.testCase,
[this.allowRetries = false, this.processQueue]);
@@ -600,6 +602,7 @@ class RunningProcess {
}
process = new Process.start(command.executable, command.arguments);
process.onExit = exitHandler;
+ process.onError = (error) { exitHandler(kErrorStartingProcess); };
startTime = new Date.now();
InputStream stdoutStream = process.stdout;
InputStream stderrStream = process.stderr;
@@ -609,7 +612,10 @@ class RunningProcess {
makeReadHandler(stdoutStringStream, stdout);
stderrStringStream.onLine =
makeReadHandler(stderrStringStream, stderr);
- timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
+ if (timeoutTimer == null) {
+ // Create one timeout timer when starting test case, remove it at end.
+ timeoutTimer = new Timer(1000 * testCase.timeout, timeoutHandler);
+ }
}
void timeoutHandler(Timer unusedTimer) {
@@ -1101,8 +1107,9 @@ class ProcessQueue {
}
if (test.usesWebDriver && _needsSelenium && !_isSeleniumAvailable) {
// The server is not ready to run Selenium tests. Put the test back in
- // the queue.
- _tests.addFirst(test);
+ // the queue. Avoid spin-polling by using a timeout.
+ _tests.add(test);
+ new Timer(1000, (timer) {_tryRunTest();}); // Don't lose a process.
return;
}
if (_verbose) {
« no previous file with comments | « tests/standalone/src/io/TestRunnerTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698