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

Unified Diff: lib/src/backend/group.dart

Issue 1372353003: Don't early-exit teardowns after a signal. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 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 | « CHANGELOG.md ('k') | lib/src/backend/invoker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/group.dart
diff --git a/lib/src/backend/group.dart b/lib/src/backend/group.dart
index 47e06e3aa1eabb6ca6eeb0336d971242a4e730b8..806c3bb7a5d4aa3c3faac94886c60b7b7f5d1e67 100644
--- a/lib/src/backend/group.dart
+++ b/lib/src/backend/group.dart
@@ -74,14 +74,14 @@ class Group {
/// If no set-up functions are declared, this returns a [Future] that
/// completes immediately.
Future runTearDowns() {
- // TODO(nweiz): Use async/await here once issue 23497 has been fixed in two
- // stable versions.
- if (parent == null) {
- return Future.forEach(tearDowns.reversed, _errorsDontStopTest);
- }
-
- return Future.forEach(tearDowns.reversed, _errorsDontStopTest)
- .then((_) => parent.runTearDowns());
+ return Invoker.current.unclosable(() {
+ var tearDowns = [];
+ for (var group = this; group != null; group = group.parent) {
+ tearDowns.addAll(group.tearDowns.reversed);
+ }
+
+ return Future.forEach(tearDowns, _errorsDontStopTest);
+ });
}
/// Runs [body] with special error-handling behavior.
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/backend/invoker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698