diff options
author | janakr <janakr@google.com> | 2017-05-08 14:49:00 -0400 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2017-05-09 10:52:36 -0400 |
commit | 1f75476f7a2f1abb449d538ef865f51ac138d013 (patch) | |
tree | 7335b500ba5bb34b5f97fb4cd30917376a38810e /src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java | |
parent | cc0f6a62d5262760d34937547470a213f6bd5b72 (diff) |
Clean up AbstractQueueVisitor's constructors.
The "concurrent" bit was supposedly around for testing purposes, but who knows if it even works anymore. Making other callsites explicitly state their ErrorClassifier gets us down to two constructors, one of which can delegate to the other.
I think having both these constructors is useful because there's a linkage between creating a new executor service and specifying that the AQV should shut down the service at the end of the visitation. And using a static create() method doesn't work because of AQV's inheritance model.
PiperOrigin-RevId: 155406771
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java b/src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java index a527549e6c..d83cf815d3 100644 --- a/src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java +++ b/src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java @@ -21,18 +21,17 @@ import com.google.devtools.build.lib.actions.MutableActionGraph.ActionConflictEx import com.google.devtools.build.lib.actions.util.ActionsTestUtil.UncheckedActionConflictException; import com.google.devtools.build.lib.actions.util.TestAction; import com.google.devtools.build.lib.concurrent.AbstractQueueVisitor; +import com.google.devtools.build.lib.concurrent.ErrorClassifier; import com.google.devtools.build.lib.util.BlazeClock; import com.google.devtools.build.lib.vfs.FileSystem; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; /** * Tests for {@link MapBasedActionGraph}. @@ -73,7 +72,7 @@ public class MapBasedActionGraphTest { actionGraph.unregisterAction(action); } - private class ActionRegisterer extends AbstractQueueVisitor { + private static class ActionRegisterer extends AbstractQueueVisitor { private final MutableActionGraph graph = new MapBasedActionGraph(); private final Artifact output; // Just to occasionally add actions that were already present. @@ -82,12 +81,13 @@ public class MapBasedActionGraphTest { private ActionRegisterer() { super( - /*concurrent=*/ true, 200, 1, TimeUnit.SECONDS, /*failFastOnException=*/ true, - "action-graph-test"); + "action-graph-test", + AbstractQueueVisitor.EXECUTOR_FACTORY, + ErrorClassifier.DEFAULT); FileSystem fileSystem = new InMemoryFileSystem(BlazeClock.instance()); Path path = fileSystem.getPath("/root/foo"); output = new Artifact(path, Root.asDerivedRoot(path)); |