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

Unified Diff: pkg/barback/test/package_graph/lazy_transformer_test.dart

Issue 241223005: Fix a deadlock bug with lazy transformer pipelining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « pkg/barback/lib/src/transform_node.dart ('k') | pkg/barback/test/transformer/declare_assets.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/test/package_graph/lazy_transformer_test.dart
diff --git a/pkg/barback/test/package_graph/lazy_transformer_test.dart b/pkg/barback/test/package_graph/lazy_transformer_test.dart
index 72e45d6bdca9df3f2e8af4bb0265c720f62d92c7..24ae2e5cfcb99b6825cc495e028a5b57bec6143b 100644
--- a/pkg/barback/test/package_graph/lazy_transformer_test.dart
+++ b/pkg/barback/test/package_graph/lazy_transformer_test.dart
@@ -354,7 +354,8 @@ main() {
buildShouldSucceed();
});
- // Regression test.
+ // Regression tests.
+
test("a lazy transformer that doesn't apply updates its passed-through asset",
() {
initGraph(["app|foo.txt"], {"app": [
@@ -376,4 +377,36 @@ main() {
expectAsset("app|foo.txt", "bar");
buildShouldSucceed();
});
+
+ test("a lazy transformer is forced while the previous lazy transformer is "
+ "available, then the previous transformer becomes unavailable", () {
+ var assets = new LazyAssetsTransformer(["app|out.one", "app|out.two"]);
+ var rewrite = new LazyRewriteTransformer("two", "three");
+ initGraph(["app|foo.in"], {"app": [[assets], [rewrite]]});
+
+ updateSources(["app|foo.in"]);
+ // Request out.one so that [assets] runs but the second does not.
+ expectAsset("app|out.one", "app|out.one");
+ buildShouldSucceed();
+
+ // Start the [rewrite] running. The output from [assets] should still be
+ // available.
+ rewrite.pauseApply();
+ expectAssetDoesNotComplete("app|out.three");
+
+ // Mark [assets] as dirty. It should re-run, since [rewrite] still needs its
+ // input.
+ updateSources(["app|foo.in"]);
+ rewrite.resumeApply();
+
+ expectAsset("app|out.three", "app|out.two.three");
+ buildShouldSucceed();
+
+ // [assets] should run once for each time foo.in was updated.
+ expect(assets.numRuns, completion(equals(2)));
+
+ // [rewrite] should run once against [assets]'s original output and once
+ // against its new output.
+ expect(rewrite.numRuns, completion(equals(2)));
+ });
}
« no previous file with comments | « pkg/barback/lib/src/transform_node.dart ('k') | pkg/barback/test/transformer/declare_assets.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698