diff options
author | shahan <shahan@google.com> | 2018-07-19 15:02:58 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-07-19 15:04:40 -0700 |
commit | 1852c94d5a62ceb54d2e1abe3259afa59bc773a4 (patch) | |
tree | f48df456b39b6d68206f66ebb0853eba0b7c4610 /src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java | |
parent | 89188eb35a5b92f248d1eeb4b1549d9d1db10951 (diff) |
PiperOrigin-RevId: 205308422
Diffstat (limited to 'src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java | 14 |
1 files changed, 12 insertions, 2 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 d10a243455..dc28c772aa 100644 --- a/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java +++ b/src/test/java/com/google/devtools/build/skyframe/MemoizingEvaluatorTest.java @@ -162,18 +162,28 @@ public class MemoizingEvaluatorTest { * <p>Returns a concurrent {@link Set} containing {@link InconsistencyData}s discovered during * evaluation. Callers should assert the desired properties on the returned set. */ - protected Set<InconsistencyData> setupGraphInconsistencyReceiver() { + protected Set<InconsistencyData> setupGraphInconsistencyReceiver(boolean allowDuplicates) { Set<InconsistencyData> inconsistencies = Sets.newConcurrentHashSet(); tester.setGraphInconsistencyReceiver( (key, otherKey, inconsistency) -> Preconditions.checkState( - inconsistencies.add(InconsistencyData.create(key, otherKey, inconsistency)))); + inconsistencies.add(InconsistencyData.create(key, otherKey, inconsistency)) + || allowDuplicates, + "Duplicate inconsistency: (%s, %s, %s)\nexisting = %s", + key, + otherKey, + inconsistency, + inconsistencies)); // #initialize must be called after setting the GraphInconsistencyReceiver for the receiver to // be registered with the test's memoizing evaluator. tester.initialize(/*keepEdges=*/ true); return inconsistencies; } + protected Set<InconsistencyData> setupGraphInconsistencyReceiver() { + return setupGraphInconsistencyReceiver(/*allowDuplicates=*/ false); + } + @Test public void smoke() throws Exception { tester.set("x", new StringValue("y")); |