From 7bf7f031c332dc483257248d1c1f98ad75bbc83b Mon Sep 17 00:00:00 2001 From: shahan Date: Sun, 4 Nov 2018 15:00:10 -0800 Subject: [PATCH] Adds some protected accessors to MemoizingEvaluatorTest. PiperOrigin-RevId: 220018722 --- .../build/skyframe/MemoizingEvaluatorTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java b/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java index 607effa2a50e4c..6536c2b9d128cb 100644 --- a/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java +++ b/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java @@ -35,6 +35,7 @@ import com.google.common.collect.Sets; import com.google.common.eventbus.EventBus; import com.google.common.testing.GcFinalization; +import com.google.common.truth.IterableSubject; import com.google.common.util.concurrent.Uninterruptibles; import com.google.devtools.build.lib.events.DelegatingEventHandler; import com.google.devtools.build.lib.events.Event; @@ -78,7 +79,7 @@ public class MemoizingEvaluatorTest { protected MemoizingEvaluatorTester tester; - private EventCollector eventCollector; + protected EventCollector eventCollector; private ExtendedEventHandler reporter; protected MemoizingEvaluator.EmittedEventState emittedEventState; @@ -148,7 +149,7 @@ protected boolean preciseEvaluationStatusStored() { return true; } - private void initializeReporter() { + protected void initializeReporter() { eventCollector = new EventCollector(); reporter = new Reporter(new EventBus(), eventCollector); tester.resetPlayedEvents(); @@ -1367,9 +1368,12 @@ protected void parentOfCycleAndErrorInternal( assertThatErrorInfo(errorInfo).hasCycleInfoThat().hasSize(1); } // But the parent itself shouldn't have a direct dep on the special error transience node. - assertThatEvaluationResult(evalResult) - .hasDirectDepsInGraphThat(top) - .doesNotContain(ErrorTransienceValue.KEY); + verifyParentDepsForParentOfCycleAndError( + assertThatEvaluationResult(evalResult).hasDirectDepsInGraphThat(top)); + } + + protected void verifyParentDepsForParentOfCycleAndError(IterableSubject parentDeps) { + parentDeps.doesNotContain(ErrorTransienceValue.KEY); } @Test