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

Unified Diff: pkg/scheduled_test/lib/scheduled_process.dart

Issue 24973002: Use SIGKILL in scheduled_process, to get around an Mac OS X bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/scheduled_process.dart
diff --git a/pkg/scheduled_test/lib/scheduled_process.dart b/pkg/scheduled_test/lib/scheduled_process.dart
index 4b2830979e5ba63c3983b31207efce9d11352a9c..c6881157bef25f9b7d91148aa96b0ec484261260 100644
--- a/pkg/scheduled_test/lib/scheduled_process.dart
+++ b/pkg/scheduled_test/lib/scheduled_process.dart
@@ -17,7 +17,9 @@ import 'src/value_future.dart';
/// synchronously. All operations on this class are scheduled.
///
/// Before running the test, either [shouldExit] or [kill] must be called on
-/// this to ensure that the process terminates when expected.
+/// this to ensure that the process terminates when expected. Note that [kill]
+/// is using SIGKILL, to ensure the process is killed on Mac OS X (an early
+/// SIGTERM on Mac OS X may be ignore).
Bob Nystrom 2013/09/27 18:03:54 "ignore" -> "ignored".
Anders Johnsen 2013/09/30 14:59:55 Nice catch, fixed.
///
/// If the test fails, this will automatically print out any stdout and stderr
/// from the process to aid debugging.
@@ -220,7 +222,7 @@ class ScheduledProcess {
if (!_exitCode.hasValue) {
killedPrematurely = true;
_endExpected = true;
- _process.value.kill();
+ _process.value.kill(ProcessSignal.SIGKILL);
// Ensure that the onException queue waits for the process to actually
// exit after being killed.
wrapFuture(_process.value.exitCode, "waiting for process "
@@ -328,7 +330,9 @@ class ScheduledProcess {
_taskBeforeEnd = currentSchedule.tasks.contents.last;
schedule(() {
_endExpected = true;
- return _process.then((p) => p.kill()).then((_) => _exitCode);
+ return _process
+ .then((p) => p.kill(ProcessSignal.SIGKILL))
+ .then((_) => _exitCode);
}, "waiting for process '$description' to die");
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698