aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/skyframe/InMemoryNodeEntryTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/google/devtools/build/skyframe/InMemoryNodeEntryTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/skyframe/InMemoryNodeEntryTest.java68
1 files changed, 33 insertions, 35 deletions
diff --git a/src/test/java/com/google/devtools/build/skyframe/InMemoryNodeEntryTest.java b/src/test/java/com/google/devtools/build/skyframe/InMemoryNodeEntryTest.java
index 23c1fca413..00681c8d3b 100644
--- a/src/test/java/com/google/devtools/build/skyframe/InMemoryNodeEntryTest.java
+++ b/src/test/java/com/google/devtools/build/skyframe/InMemoryNodeEntryTest.java
@@ -32,16 +32,13 @@ import com.google.devtools.build.lib.util.GroupedList.GroupedListHelper;
import com.google.devtools.build.skyframe.NodeEntry.DependencyState;
import com.google.devtools.build.skyframe.SkyFunctionException.ReifiedSkyFunctionException;
import com.google.devtools.build.skyframe.SkyFunctionException.Transience;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-
import javax.annotation.Nullable;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
/**
* Tests for {@link InMemoryNodeEntry}.
@@ -69,7 +66,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void signalEntry() {
+ public void signalEntry() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep1 = key("dep1");
@@ -95,7 +92,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void reverseDeps() {
+ public void reverseDeps() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
SkyKey mother = key("mother");
SkyKey father = key("father");
@@ -111,7 +108,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void errorValue() {
+ public void errorValue() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
ReifiedSkyFunctionException exception = new ReifiedSkyFunctionException(
@@ -125,7 +122,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void errorAndValue() {
+ public void errorAndValue() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
ReifiedSkyFunctionException exception = new ReifiedSkyFunctionException(
@@ -138,7 +135,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void crashOnNullErrorAndValue() {
+ public void crashOnNullErrorAndValue() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
try {
@@ -162,7 +159,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void crashOnDifferentValue() {
+ public void crashOnDifferentValue() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
setValue(entry, new SkyValue() {}, /*errorInfo=*/null, /*graphVersion=*/0L);
@@ -176,7 +173,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void dirtyLifecycle() {
+ public void dirtyLifecycle() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -208,7 +205,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void changedLifecycle() {
+ public void changedLifecycle() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -237,7 +234,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void markDirtyThenChanged() {
+ public void markDirtyThenChanged() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
addTemporaryDirectDep(entry, key("dep"));
@@ -261,7 +258,7 @@ public class InMemoryNodeEntryTest {
@Test
- public void markChangedThenDirty() {
+ public void markChangedThenDirty() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
addTemporaryDirectDep(entry, key("dep"));
@@ -284,7 +281,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void crashOnTwiceMarkedChanged() {
+ public void crashOnTwiceMarkedChanged() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
setValue(entry, new SkyValue() {}, /*errorInfo=*/null, /*graphVersion=*/0L);
@@ -300,7 +297,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void crashOnTwiceMarkedDirty() {
+ public void crashOnTwiceMarkedDirty() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
addTemporaryDirectDep(entry, key("dep"));
@@ -316,7 +313,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void crashOnAddReverseDepTwice() {
+ public void crashOnAddReverseDepTwice() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
SkyKey parent = key("parent");
assertEquals(DependencyState.NEEDS_SCHEDULING, entry.addReverseDepAndCheckIfDone(parent));
@@ -331,7 +328,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void crashOnAddReverseDepTwiceAfterDone() {
+ public void crashOnAddReverseDepTwiceAfterDone() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
setValue(entry, new SkyValue() {}, /*errorInfo=*/null, /*graphVersion=*/0L);
@@ -348,7 +345,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void crashOnAddReverseDepBeforeAfterDone() {
+ public void crashOnAddReverseDepBeforeAfterDone() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
SkyKey parent = key("parent");
assertEquals(DependencyState.NEEDS_SCHEDULING, entry.addReverseDepAndCheckIfDone(parent));
@@ -364,7 +361,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void pruneBeforeBuild() {
+ public void pruneBeforeBuild() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
SkyKey dep = key("dep");
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
@@ -412,7 +409,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void pruneAfterBuild() {
+ public void pruneAfterBuild() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -435,7 +432,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void noPruneWhenDetailsChange() {
+ public void noPruneWhenDetailsChange() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -471,7 +468,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void pruneWhenDepGroupReordered() {
+ public void pruneWhenDepGroupReordered() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -511,7 +508,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void errorInfoCannotBePruned() {
+ public void errorInfoCannotBePruned() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -538,7 +535,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void getDependencyGroup() {
+ public void getDependencyGroup() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -562,7 +559,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void maintainDependencyGroupAfterRemoval() {
+ public void maintainDependencyGroupAfterRemoval() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -592,7 +589,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void pruneWhenDepsChange() {
+ public void pruneWhenDepsChange() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
SkyKey dep = key("dep");
@@ -616,7 +613,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void checkDepsOneByOne() {
+ public void checkDepsOneByOne() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(null); // Start evaluation.
List<SkyKey> deps = new ArrayList<>();
@@ -643,7 +640,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void signalOnlyNewParents() {
+ public void signalOnlyNewParents() throws InterruptedException {
NodeEntry entry = new InMemoryNodeEntry();
entry.addReverseDepAndCheckIfDone(key("parent"));
setValue(entry, new SkyValue() {}, /*errorInfo=*/null, /*graphVersion=*/0L);
@@ -657,7 +654,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void testClone() {
+ public void testClone() throws InterruptedException {
InMemoryNodeEntry entry = new InMemoryNodeEntry();
IntVersion version = IntVersion.of(0);
IntegerValue originalValue = new IntegerValue(42);
@@ -701,7 +698,7 @@ public class InMemoryNodeEntryTest {
}
@Test
- public void getGroupedDirectDeps() {
+ public void getGroupedDirectDeps() throws InterruptedException {
InMemoryNodeEntry entry = new InMemoryNodeEntry();
ImmutableList<ImmutableSet<SkyKey>> groupedDirectDeps = ImmutableList.of(
ImmutableSet.of(key("1A")),
@@ -726,8 +723,9 @@ public class InMemoryNodeEntryTest {
}
}
- private static Set<SkyKey> setValue(NodeEntry entry, SkyValue value,
- @Nullable ErrorInfo errorInfo, long graphVersion) {
+ private static Set<SkyKey> setValue(
+ NodeEntry entry, SkyValue value, @Nullable ErrorInfo errorInfo, long graphVersion)
+ throws InterruptedException {
return entry.setValue(
ValueWithMetadata.normal(value, errorInfo, NO_EVENTS), IntVersion.of(graphVersion));
}