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

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

Issue 107153004: Make sure we mark all depending commands (transitively!) UnableToRun if a command fails (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years 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: dart/tools/testing/dart/test_runner.dart
diff --git a/dart/tools/testing/dart/test_runner.dart b/dart/tools/testing/dart/test_runner.dart
index 38f500bef2821455503d8d8e891709810c533034..22b0d5c58e1e00f15162db85c245dda6661ea0b0 100644
--- a/dart/tools/testing/dart/test_runner.dart
+++ b/dart/tools/testing/dart/test_runner.dart
@@ -1794,10 +1794,12 @@ class CommandEnqueuer {
});
eventCondition((e) => e is dgraph.StateChangedEvent).listen((event) {
- if (event.from == dgraph.NodeState.Processing) {
- assert(FINISHED_STATES.contains(event.to));
- for (var dependendNode in event.node.neededFor) {
- _changeNodeStateIfNecessary(dependendNode);
+ if ([dgraph.NodeState.Waiting,
+ dgraph.NodeState.Processing].contains(event.from)) {
+ if (FINISHED_STATES.contains(event.to)){
+ for (var dependendNode in event.node.neededFor) {
+ _changeNodeStateIfNecessary(dependendNode);
+ }
}
}
});
@@ -1806,23 +1808,25 @@ class CommandEnqueuer {
// Called when either a new node was added or if one of it's dependencies
// changed it's state.
void _changeNodeStateIfNecessary(dgraph.Node node) {
- assert(INIT_STATES.contains(node.state));
- bool allDependenciesFinished =
- node.dependencies.every((node) => FINISHED_STATES.contains(node.state));
-
- var newState = dgraph.NodeState.Waiting;
- if (allDependenciesFinished) {
- bool allDependenciesSuccessful = node.dependencies.every(
- (dep) => dep.state == dgraph.NodeState.Successful);
+ if (INIT_STATES.contains(node.state)) {
+ bool anyDependenciesUnsuccessful = node.dependencies.any(
+ (dep) => [dgraph.NodeState.Failed,
+ dgraph.NodeState.UnableToRun].contains(dep.state));
- if (allDependenciesSuccessful) {
- newState = dgraph.NodeState.Enqueuing;
- } else {
+ var newState = dgraph.NodeState.Waiting;
+ if (anyDependenciesUnsuccessful) {
newState = dgraph.NodeState.UnableToRun;
+ } else {
+ bool allDependenciesSuccessful = node.dependencies.every(
+ (dep) => dep.state == dgraph.NodeState.Successful);
+
+ if (allDependenciesSuccessful) {
+ newState = dgraph.NodeState.Enqueuing;
+ }
+ }
+ if (node.state != newState) {
+ _graph.changeState(node, newState);
}
- }
- if (node.state != newState) {
- _graph.changeState(node, newState);
}
}
}
« 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