aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
diff options
context:
space:
mode:
authorGravatar Mark Schaller <mschaller@google.com>2015-11-02 17:07:29 +0000
committerGravatar David Chen <dzc@google.com>2015-11-02 23:18:53 +0000
commit96f789448481eb7a981ed76c344c42042b3c30cb (patch)
tree9e6582a8e677f3fcc8e2e2b31c12b85f4fed98fc /src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
parent29375d405399a2d39b42c853849e39cb82048c19 (diff)
Cleanup ValueVisitor (and dirty QuiescingExecutor)
Raises the level of abstraction of ValueVisitor's dependence on AbstractQueueVisitor. Except for the "ForTestingOnly" methods now available on the QuiescingExecutor interface, ValueVisitor is agnostic to the implementation of its executor. This also cleans up the full spectrum of visibility modifiers on ValueVisitor methods, all of which ought to be private. -- MOS_MIGRATED_REVID=106847453
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java b/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
index 7bc6912e95..f9cf3ac32d 100644
--- a/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
+++ b/src/test/java/com/google/devtools/build/lib/concurrent/AbstractQueueVisitorTest.java
@@ -190,16 +190,19 @@ public class AbstractQueueVisitorTest {
}
});
- TestThread interrupterThread = new TestThread() {
- @Override
- public void runTest() throws Exception {
- latch1.await();
- mainThread.interrupt();
- assertTrue(visitor.awaitInterruptionForTestingOnly(TestUtils.WAIT_TIMEOUT_MILLISECONDS,
- TimeUnit.MILLISECONDS));
- latch2.countDown();
- }
- };
+ TestThread interrupterThread =
+ new TestThread() {
+ @Override
+ public void runTest() throws Exception {
+ latch1.await();
+ mainThread.interrupt();
+ assertTrue(
+ visitor
+ .getInterruptionLatchForTestingOnly()
+ .await(TestUtils.WAIT_TIMEOUT_MILLISECONDS, TimeUnit.MILLISECONDS));
+ latch2.countDown();
+ }
+ };
interrupterThread.start();
@@ -461,7 +464,7 @@ public class AbstractQueueVisitorTest {
try {
assertTrue(
interrupt
- ? visitor.awaitInterruptionForTestingOnly(1, TimeUnit.MINUTES)
+ ? visitor.getInterruptionLatchForTestingOnly().await(1, TimeUnit.MINUTES)
: visitor.getExceptionLatchForTestingOnly().await(1, TimeUnit.MINUTES));
} catch (InterruptedException e) {
// Unexpected.