aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-08-15 21:54:55 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-08-16 15:21:17 +0000
commit3c0adb26bac6d756fb97e4bcc6d4e5b2cefa5eeb (patch)
treec77f6438711f4b23d6c528907a81e23dc9e6dc91 /src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java
parent89125d5ee83f562c309a792a7c56ce24452e61ea (diff)
Allow Skyframe graph lookups and value retrievals to throw InterruptedException.
The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer. -- MOS_MIGRATED_REVID=130327770
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java
index 4556c762fb..18a747ee97 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/TestsInSuiteFunction.java
@@ -35,7 +35,6 @@ import com.google.devtools.build.skyframe.SkyFunction;
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import com.google.devtools.build.skyframe.ValueOrException;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -44,7 +43,6 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-
import javax.annotation.Nullable;
/**
@@ -54,7 +52,7 @@ import javax.annotation.Nullable;
// TODO(ulfjack): What about test_suite rules that include each other.
final class TestsInSuiteFunction implements SkyFunction {
@Override
- public SkyValue compute(SkyKey key, Environment env) {
+ public SkyValue compute(SkyKey key, Environment env) throws InterruptedException {
TestsInSuite expansion = (TestsInSuite) key.argument();
ResolvedTargets<Target> result =
computeTestsInSuite(env, expansion.getTestSuite(), expansion.isStrict());
@@ -65,13 +63,13 @@ final class TestsInSuiteFunction implements SkyFunction {
}
/**
- * Populates 'result' with all the tests associated with the specified
- * 'testSuite'. Throws an exception if any target is missing.
+ * Populates 'result' with all the tests associated with the specified 'testSuite'. Throws an
+ * exception if any target is missing.
*
- * <p>CAUTION! Keep this logic consistent with {@code TestSuite}!
+ * <p>CAUTION! Keep this logic consistent with {@code TestSuite}!
*/
- private ResolvedTargets<Target> computeTestsInSuite(
- Environment env, Rule testSuite, boolean strict) {
+ private static ResolvedTargets<Target> computeTestsInSuite(
+ Environment env, Rule testSuite, boolean strict) throws InterruptedException {
ResolvedTargets.Builder<Target> builder = ResolvedTargets.builder();
List<Target> testsAndSuites = new ArrayList<>();
// Note that testsAndSuites can contain input file targets; the test_suite rule does not
@@ -132,8 +130,9 @@ final class TestsInSuiteFunction implements SkyFunction {
* found a problem during the lookup process; the actual error message is reported to the
* environment.
*/
- private boolean getPrerequisites(Environment env, Rule testSuite, String attrName,
- List<Target> targets) {
+ private static boolean getPrerequisites(
+ Environment env, Rule testSuite, String attrName, List<Target> targets)
+ throws InterruptedException {
List<Label> labels =
NonconfigurableAttributeMapper.of(testSuite).get(attrName, BuildType.LABEL_LIST);
Set<PackageIdentifier> pkgIdentifiers = new LinkedHashSet<>();