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

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

Issue 220243011: Prevent test.dart warning "TestCase would be finished twice" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | 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 da880bd6af4806978c7871719b19869dbe4f1247..ed530cce4bae9d8df4c843f044b310979aef6394 100644
--- a/dart/tools/testing/dart/test_runner.dart
+++ b/dart/tools/testing/dart/test_runner.dart
@@ -2607,6 +2607,7 @@ class TestCaseCompleter {
TestCaseCompleter(this.graph, this.enqueuer, this.commandQueue) {
var eventCondition = graph.events.where;
+ bool finishedRemainingTestCases = false;
Bill Hesse 2014/04/02 07:52:54 Should this member be private? I don't see any us
kustermann 2014/04/02 08:01:57 This is a variable inside a method/constructor, th
// Store all the command outputs -- they will be delivered synchronously
// (i.e. before state changes in the graph)
@@ -2614,6 +2615,7 @@ class TestCaseCompleter {
_outputs[output.command] = output;
}, onDone: () {
_completeTestCasesIfPossible(new List.from(enqueuer.remainingTestCases));
+ finishedRemainingTestCases = true;
assert(enqueuer.remainingTestCases.isEmpty);
_checkDone();
});
kustermann 2014/04/01 23:38:14 When this onDone is called, all remaining TestCase
@@ -2622,7 +2624,8 @@ class TestCaseCompleter {
// changes.
eventCondition((event) => event is dgraph.StateChangedEvent)
.listen((dgraph.StateChangedEvent event) {
- if (event.from == dgraph.NodeState.Processing) {
+ if (event.from == dgraph.NodeState.Processing &&
+ !finishedRemainingTestCases ) {
var command = event.node.userData;
assert(COMPLETED_STATES.contains(event.to));
@@ -2653,7 +2656,7 @@ class TestCaseCompleter {
}
}
- void _completeTestCasesIfPossible(Iterable<TestCase> testCases){
+ 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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698