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

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

Issue 11343009: Get rid of 'close' on process. It is very easy to use incorrectly and cut off data from your stream… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 years, 2 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/io/process_working_directory_test.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | 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 14927daf80fce1a229c4afaa8c7890cf3df6b753..c270a10eec2e6ce708dc3ebcb648388b49072c72 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -609,7 +609,6 @@ class RunningProcess {
* the actual test and its output is analyzed in [testComplete].
*/
void stepExitHandler(int exitCode) {
- process.close();
process = null;
int totalSteps = testCase.commands.length;
String suffix =' (step $currentStep of $totalSteps)';
@@ -762,7 +761,6 @@ class BatchRunnerProcess {
_executable = testCase.commands.last.executable;
_batchArguments = testCase.batchRunnerArguments;
_process.onExit = (exitCode) {
- _process.close();
_startProcess(() {
doStartTest(testCase);
});
@@ -778,7 +776,6 @@ class BatchRunnerProcess {
Completer completer = new Completer();
Timer killTimer;
_process.onExit = (exitCode) {
- _process.close();
if (killTimer != null) killTimer.cancel();
completer.complete(true);
};
@@ -926,10 +923,8 @@ class BatchRunnerProcess {
}
_stderrDrained = true;
_stdoutDrained = true;
- _process.close();
_startProcess(_reportResult);
} else { // No active test case running.
- _process.close();
_process = null;
}
}
@@ -1111,6 +1106,8 @@ class ProcessQueue {
Future processFuture = Process.start(cmd, arg);
processFuture.then((Process p) {
+ // Drain stderr to not leak resources.
+ p.stderr.onData = p.stderr.read;
final StringInputStream stdoutStringStream =
new StringInputStream(p.stdout);
stdoutStringStream.onLine = () {
« no previous file with comments | « tests/standalone/io/process_working_directory_test.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698