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

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

Issue 1940853002: Add support for timeouts when using AdbPrecompilationCommand (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
« tools/testing/dart/android.dart ('K') | « tools/testing/dart/android.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 654dd95453aad7f6bf0c4badbd164596b49d6096..8d189ae90a65ee3caa427eff850bf91870802d09 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -2504,7 +2504,8 @@ class CommandExecutorImpl implements CommandExecutor {
} else if (command is AdbPrecompilationCommand) {
assert(adbDevicePool != null);
return adbDevicePool.acquireDevice().then((AdbDevice device) {
- return _runAdbPrecompilationCommand(device, command).whenComplete(() {
+ return _runAdbPrecompilationCommand(
+ device, command, timeout).whenComplete(() {
adbDevicePool.releaseDevice(device);
});
});
@@ -2514,7 +2515,7 @@ class CommandExecutorImpl implements CommandExecutor {
}
Future<CommandOutput> _runAdbPrecompilationCommand(
- AdbDevice device, AdbPrecompilationCommand command) async {
+ AdbDevice device, AdbPrecompilationCommand command, int timeout) async {
var runner = command.precompiledRunnerFilename;
var testdir = command.precompiledTestDirectory;
var devicedir = '/data/local/tmp/precompilation-testing';
@@ -2529,6 +2530,8 @@ class CommandExecutorImpl implements CommandExecutor {
.map((path) => path.substring(path.lastIndexOf('/') + 1))
.toList();
+ var timeoutDuration = new Duration(seconds: timeout);
+
// All closures are of type "Future<AdbCommandResult> run()"
List<Function> steps = [];
@@ -2552,11 +2555,11 @@ class CommandExecutorImpl implements CommandExecutor {
if (command.useBlobs) {
steps.add(() => device.runAdbShellCommand(
['$devicedir/runner', '--run-precompiled-snapshot=$deviceTestDir',
- '--use_blobs', 'ignored.dart']));
+ '--use_blobs', 'ignored.dart'], timeout: timeoutDuration));
} else {
steps.add(() => device.runAdbShellCommand(
['$devicedir/runner', '--run-precompiled-snapshot=$deviceTestDir',
- 'ignored.dart']));
+ 'ignored.dart'], timeout: timeoutDuration));
}
var stopwatch = new Stopwatch()..start();
@@ -2587,7 +2590,7 @@ class CommandExecutorImpl implements CommandExecutor {
if (result.exitCode != 0) break;
}
return createCommandOutput(
- command, result.exitCode, false, UTF8.encode('$writer'),
+ command, result.exitCode, result.timedOut, UTF8.encode('$writer'),
[], stopwatch.elapsed, false);
}
« tools/testing/dart/android.dart ('K') | « tools/testing/dart/android.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698