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

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

Issue 12732004: Add a bunch of ugly debugging prints to figure out why the bots are failing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 7 years, 9 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 | pkg/scheduled_test/lib/src/schedule.dart » ('j') | 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 665f2917bf170f09b4301194d5b91181c63cccda..9ebd3ae94b1afd1cde87dd6b14cf3791fb723789 100644
--- a/pkg/scheduled_test/lib/scheduled_process.dart
+++ b/pkg/scheduled_test/lib/scheduled_process.dart
@@ -154,23 +154,35 @@ class ScheduledProcess {
// queue where the process will be killed, rather than blocking the tasks
// queue waiting for the process to exit.
_process.then((p) => p.exitCode).then((exitCode) {
+ print("[$description] exitCode completed with value '$exitCode'");
if (_endExpected) {
+ print("[$description] expected the process to end, passing '$exitCode' to completer");
exitCodeCompleter.complete(exitCode);
return;
+ } else {
+ print("[$description] did not expect the process to end, maybe we should wait for the current task to end");
}
wrapFuture(pumpEventQueue().then((_) {
- if (currentSchedule.currentTask != _taskBeforeEnd) return;
+ if (currentSchedule.currentTask != _taskBeforeEnd) {
+ print("[$description] not waiting for the current task to end");
+ return;
+ }
+ print("[$description] waiting for current task to end to see if the end will be expected");
// If we're one task before the end was scheduled, wait for that task
// to complete and pump the event queue so that _endExpected will be
// set.
return _taskBeforeEnd.result.then((_) => pumpEventQueue());
}).then((_) {
+ print("[$description] passing '$exitCode' to completer");
exitCodeCompleter.complete(exitCode);
if (!_endExpected) {
+ print("[$description] end not expected, throwing error");
throw "Process '${this.description}' ended earlier than scheduled "
"with exit code $exitCode.";
+ } else {
+ print("[$description] end expected, not throwing error");
}
}));
});
@@ -190,6 +202,7 @@ class ScheduledProcess {
/// debug information if an error occurs.
void _scheduleExceptionCleanup() {
currentSchedule.onException.schedule(() {
+ print("[$description] cleaning up after exception");
_stdoutSubscription.cancel();
_stderrSubscription.cancel();
@@ -197,18 +210,22 @@ class ScheduledProcess {
var killedPrematurely = false;
if (!_exitCode.hasValue) {
+ print("[$description] exit code has not been set, killing process");
var killedPrematurely = true;
_endExpected = true;
_process.value.kill();
// Ensure that the onException queue waits for the process to actually
// exit after being killed.
wrapFuture(_process.value.exitCode);
+ } else {
+ print("[$description] exit code has been set to '${_process.value.exitCode.value}', process is dead");
}
return Future.wait([
_stdoutLog.toList(),
_stderrLog.toList()
]).then((results) {
+ print("[$description] got stdout/stderr, killedPrematurely=$killedPrematurely, exitCode.value=${_exitCode.value}");
var stdout = results[0].join("\n");
var stderr = results[1].join("\n");
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/schedule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698