aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/actions/ConcurrentMultimapWithHeadElementTest.java
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-05-08 14:49:00 -0400
committerGravatar Kristina Chodorow <kchodorow@google.com>2017-05-09 10:52:36 -0400
commit1f75476f7a2f1abb449d538ef865f51ac138d013 (patch)
tree7335b500ba5bb34b5f97fb4cd30917376a38810e /src/test/java/com/google/devtools/build/lib/actions/ConcurrentMultimapWithHeadElementTest.java
parentcc0f6a62d5262760d34937547470a213f6bd5b72 (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/ConcurrentMultimapWithHeadElementTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/actions/ConcurrentMultimapWithHeadElementTest.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/actions/ConcurrentMultimapWithHeadElementTest.java b/src/test/java/com/google/devtools/build/lib/actions/ConcurrentMultimapWithHeadElementTest.java
index 456b394a85..1ed396aae6 100644
--- a/src/test/java/com/google/devtools/build/lib/actions/ConcurrentMultimapWithHeadElementTest.java
+++ b/src/test/java/com/google/devtools/build/lib/actions/ConcurrentMultimapWithHeadElementTest.java
@@ -20,17 +20,16 @@ import static org.junit.Assert.assertTrue;
import com.google.common.testing.GcFinalization;
import com.google.devtools.build.lib.concurrent.AbstractQueueVisitor;
+import com.google.devtools.build.lib.concurrent.ErrorClassifier;
import com.google.devtools.build.lib.testutil.TestThread;
import com.google.devtools.build.lib.testutil.TestUtils;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
import java.lang.ref.WeakReference;
import java.util.concurrent.CountDownLatch;
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 ConcurrentMultimapWithHeadElement.
@@ -128,19 +127,20 @@ public class ConcurrentMultimapWithHeadElementTest {
}
}
- private class StressTester extends AbstractQueueVisitor {
+ private static class StressTester extends AbstractQueueVisitor {
private final ConcurrentMultimapWithHeadElement<Boolean, Integer> multimap =
new ConcurrentMultimapWithHeadElement<>();
private final AtomicInteger actionCount = new AtomicInteger(0);
private StressTester() {
super(
- /*concurrent=*/ true,
200,
1,
TimeUnit.SECONDS,
/*failFastOnException=*/ true,
- "action-graph-test");
+ "action-graph-test",
+ AbstractQueueVisitor.EXECUTOR_FACTORY,
+ ErrorClassifier.DEFAULT);
}
private void addAndRemove(final Boolean key, final Integer add, final Integer remove) {