Don't assert in method that is called on other thread.

--
MOS_MIGRATED_REVID=86478884
diff --git a/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java b/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java
index 5394437..64b5948 100644
--- a/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java
+++ b/src/test/java/com/google/devtools/build/skyframe/ParallelEvaluatorTest.java
@@ -1985,6 +1985,10 @@
     final SkyKey otherKey = GraphTester.toSkyKey("otherKey");
     tester.getOrCreate(errorKey).setHasError(true);
     final AtomicInteger numOtherInvocations = new AtomicInteger(0);
+
+    final AtomicReference<String> bogusInvocationCount = new AtomicReference<>(null);
+    final AtomicReference<String> nonNullValue = new AtomicReference<>(null);
+
     tester.getOrCreate(otherKey).setBuilder(new SkyFunction() {
       @Override
       public SkyValue compute(SkyKey skyKey, Environment env) throws SkyFunctionException {
@@ -1995,8 +1999,13 @@
         }
         try {
           SkyValue value = env.getValueOrThrow(errorKey, SomeErrorException.class);
-          assertTrue("bogus non-null value " + value, value == null);
-          assertEquals(1, invocations);
+          if (value != null) {
+            nonNullValue.set("bogus non-null value " + value);
+          }
+          if (invocations != 1) {
+            bogusInvocationCount.set("bogus invocation count: " + invocations);
+          }
+
           otherDone.countDown();
           throw new GenericFunctionException(new SomeErrorException("other"),
               Transience.PERSISTENT);
@@ -2023,6 +2032,8 @@
     });
     EvaluationResult<StringValue> result = eval(/*keepGoing=*/false,
         ImmutableList.of(errorKey, otherKey));
+    assertTrue(nonNullValue.get(), nonNullValue.get() == null);
+    assertTrue(bogusInvocationCount.get(), bogusInvocationCount.get() == null);
     assertEquals(null, graph.get(otherKey));
     assertTrue(result.hasError());
     assertEquals(errorKey, result.getError().getRootCauseOfException());