diff options
author | 2015-10-30 22:15:34 +0000 | |
---|---|---|
committer | 2015-11-02 16:55:28 +0000 | |
commit | 5350b3154665ebb37e10e6261686eb646ea23220 (patch) | |
tree | 8bce3e4c5e8e708577ad01d3e361f93a2a008548 /src/test/java/com/google/devtools/build/lib/actions/MapBasedActionGraphTest.java | |
parent | e45a363cf7c2abfdf1dd67cfb7ed0a54d1ed52c2 (diff) |
Introduce QuiescingExecutor
This interface (mostly) encapsulates what the ValueVisitor expects
from the AbstractQueueVisitor class it currently inherits from. This
makes it easier for a future CL to change ValueVisitor's strategy of
code reuse from inheritance to composition.
RELNOTES:
--
MOS_MIGRATED_REVID=106728863
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 | 40 |
1 files changed, 21 insertions, 19 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 6d5a23e665..2dd07ed868 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 @@ -91,27 +91,29 @@ public class MapBasedActionGraphTest { } private void registerAction(final Action action) { - enqueue(new Runnable() { - @Override - public void run() { - try { - graph.registerAction(action); - } catch (ActionConflictException e) { - throw new UncheckedActionConflictException(e); - } - doRandom(); - } - }); + execute( + new Runnable() { + @Override + public void run() { + try { + graph.registerAction(action); + } catch (ActionConflictException e) { + throw new UncheckedActionConflictException(e); + } + doRandom(); + } + }); } private void unregisterAction(final Action action) { - enqueue(new Runnable() { - @Override - public void run() { - graph.unregisterAction(action); - doRandom(); - } - }); + execute( + new Runnable() { + @Override + public void run() { + graph.unregisterAction(action); + doRandom(); + } + }); } private void doRandom() { @@ -134,7 +136,7 @@ public class MapBasedActionGraphTest { } private void work() throws InterruptedException { - work(/*failFastOnInterrupt=*/true); + awaitQuiescence(/*interruptWorkers=*/ true); } } |