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

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

Issue 2987393002: enable batch mode for dartdevc tests, also fix status so ddc bots pass (Closed)
Patch Set: fix Created 3 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 | « tools/testing/dart/configuration.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 d329b4f0b00d7c00c6cef2261abfd220b593e7a8..890b02acccbc1a2d53776d0deb90f887a5f3632d 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -605,6 +605,7 @@ class BatchRunnerProcess {
String _status;
DateTime _startTime;
Timer _timer;
+ int _testCount = 0;
Future<CommandOutput> runCommand(String runnerType, ProcessCommand command,
int timeout, List<String> arguments) {
@@ -620,12 +621,17 @@ class BatchRunnerProcess {
_arguments = arguments;
_processEnvironmentOverrides = command.environmentOverrides;
+ // TOOD(jmesserly): this restarts `dartdevc --batch` to work around a
+ // memory leak, see https://github.com/dart-lang/sdk/issues/30314.
+ var clearMemoryLeak = command is CompilationCommand &&
+ command.displayName == 'dartdevc' &&
+ ++_testCount % 100 == 0;
if (_process == null) {
// Start process if not yet started.
_startProcess(() {
doStartTest(command, timeout);
});
- } else if (!sameRunnerType) {
+ } else if (!sameRunnerType || clearMemoryLeak) {
// Restart this runner with the right executable for this test if needed.
_processExitHandler = (_) {
_startProcess(() {
@@ -1164,6 +1170,11 @@ class CommandExecutorImpl implements CommandExecutor {
} else if (command is AnalysisCommand && globalConfiguration.batch) {
return _getBatchRunner(command.displayName)
.runCommand(command.displayName, command, timeout, command.arguments);
+ } else if (command is CompilationCommand &&
+ command.displayName == 'dartdevc' &&
+ globalConfiguration.batch) {
+ return _getBatchRunner(command.displayName)
+ .runCommand(command.displayName, command, timeout, command.arguments);
} else if (command is ScriptCommand) {
return command.run();
} else if (command is AdbPrecompilationCommand) {
« no previous file with comments | « tools/testing/dart/configuration.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698