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

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

Issue 26229005: Fixed (currently harmless) bug in test_runner and implemented separate dart2js compilation cache (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | 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 8e1363af458b18cbacf6c02dc3e0b04bd0c7093b..a396abdd4d27832a1f19ac159a413cd97b3a103d 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -2155,6 +2155,10 @@ class TestCaseCompleter {
// (i.e. before state changes in the graph)
commandQueue.completedCommands.listen((CommandOutput output) {
_outputs[output.command] = output;
+ }, onDone: () {
+ _completeTestCasesIfPossible(new List.from(enqueuer.remainingTestCases));
+ assert(enqueuer.remainingTestCases.isEmpty);
+ _checkDone();
});
// Listen for NodeState.Processing -> NodeState.{Successfull,Failed}
@@ -2162,15 +2166,13 @@ class TestCaseCompleter {
eventCondition((event) => event is dgraph.StateChangedEvent)
.listen((dgraph.StateChangedEvent event) {
if (event.from == dgraph.NodeState.Processing) {
+ var command = event.node.userData;
+
assert(COMPLETED_STATES.contains(event.to));
- _completeTestCasesIfPossible(event.node.userData);
+ assert(_outputs[command] != null);
- if (!_closed &&
- graph.isSealed &&
- enqueuer.remainingTestCases.isEmpty) {
- _controller.close();
- _closed = true;
- }
+ _completeTestCasesIfPossible(enqueuer.command2testCases[command]);
+ _checkDone();
}
});
@@ -2187,11 +2189,14 @@ class TestCaseCompleter {
Stream<TestCase> get finishedTestCases => _controller.stream;
- void _completeTestCasesIfPossible(Command command) {
- assert(_outputs[command] != null);
-
- var testCases = enqueuer.command2testCases[command];
+ void _checkDone() {
+ if (!_closed && graph.isSealed && enqueuer.remainingTestCases.isEmpty) {
+ _controller.close();
+ _closed = true;
+ }
+ }
+ void _completeTestCasesIfPossible(Iterable<TestCase> testCases){
// Update TestCases with command outputs
for (TestCase test in testCases) {
for (var icommand in test.commands) {
« no previous file with comments | « no previous file | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698