OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library scheduled_test.scheduled_process; | 5 library scheduled_test.scheduled_process; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 | 10 |
(...skipping 186 matching lines...) Loading... | |
197 currentSchedule.heartbeat(); | 197 currentSchedule.heartbeat(); |
198 return chunk; | 198 return chunk; |
199 }) | 199 }) |
200 .transform(_encoding.decoder) | 200 .transform(_encoding.decoder) |
201 .transform(new LineSplitter())); | 201 .transform(new LineSplitter())); |
202 } | 202 } |
203 | 203 |
204 /// Schedule an exception handler that will clean up the process and provide | 204 /// Schedule an exception handler that will clean up the process and provide |
205 /// debug information if an error occurs. | 205 /// debug information if an error occurs. |
206 void _scheduleExceptionCleanup() { | 206 void _scheduleExceptionCleanup() { |
207 if (description == "pub get") return; | |
Bob Nystrom
2014/08/20 23:50:23
You should check this in and immediately wipe it f
| |
207 currentSchedule.onException.schedule(() { | 208 currentSchedule.onException.schedule(() { |
208 _stdoutCanceller(); | 209 _stdoutCanceller(); |
209 _stderrCanceller(); | 210 _stderrCanceller(); |
210 | 211 |
211 if (!_process.hasValue) return null; | 212 if (!_process.hasValue) return null; |
212 | 213 |
213 var killedPrematurely = false; | 214 var killedPrematurely = false; |
214 if (!_exitCode.hasValue) { | 215 if (!_exitCode.hasValue) { |
215 killedPrematurely = true; | 216 killedPrematurely = true; |
216 _process.value.kill(ProcessSignal.SIGKILL); | 217 _process.value.kill(ProcessSignal.SIGKILL); |
(...skipping 99 matching lines...) Loading... | |
316 schedule(() { | 317 schedule(() { |
317 return _exitCode.then((exitCode) { | 318 return _exitCode.then((exitCode) { |
318 if (expectedExitCode != null) { | 319 if (expectedExitCode != null) { |
319 expect(exitCode, equals(expectedExitCode)); | 320 expect(exitCode, equals(expectedExitCode)); |
320 } | 321 } |
321 }); | 322 }); |
322 }, "waiting for process '$description' to exit"); | 323 }, "waiting for process '$description' to exit"); |
323 _scheduledExitTask = currentSchedule.tasks.contents.last; | 324 _scheduledExitTask = currentSchedule.tasks.contents.last; |
324 } | 325 } |
325 } | 326 } |
OLD | NEW |