aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Murphy <murj@google.com>2024-04-17 17:39:30 -0700
committerTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2024-04-18 22:04:39 +0000
commit871b72281a37ea14f9fe501e43d0d4ab381eda56 (patch)
treeebb083e83ae4ed3aef17ba473160477588863082
parent42b719d478b410505368e1f5a4ad3265b63ed422 (diff)
downloadtradefederation-871b72281a37ea14f9fe501e43d0d4ab381eda56.tar.gz
Actually fall back to strict sharding if splitting ITestSuite fails.
Trying to just run it as a part of a dynamic sharding pool didn't work, so we should just fall back to strict sharding which is safer. Bug: 332759647 Test: TBD Change-Id: I4a45ecb8a1876ba738a96f5a8ff1de79128ad43c
-rw-r--r--src/com/android/tradefed/invoker/shard/DynamicShardHelper.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/tradefed/invoker/shard/DynamicShardHelper.java b/src/com/android/tradefed/invoker/shard/DynamicShardHelper.java
index b40629ece..b804765e1 100644
--- a/src/com/android/tradefed/invoker/shard/DynamicShardHelper.java
+++ b/src/com/android/tradefed/invoker/shard/DynamicShardHelper.java
@@ -94,6 +94,12 @@ public class DynamicShardHelper extends StrictShardHelper {
shouldDelegate = true;
}
+ List<ITestSuite> allModules = getAllModules(config, testInfo);
+ if (allModules == null) {
+ CLog.w("Failed to split ITestSuite, falling back to strict mode.");
+ shouldDelegate = true;
+ }
+
if (shouldDelegate) {
CLog.d(
"Setting option 'remote-dynamic-sharding' to false since precondition checks"
@@ -107,7 +113,6 @@ public class DynamicShardHelper extends StrictShardHelper {
String poolId = String.format("invocation-%s", invocationId);
- List<ITestSuite> allModules = getAllModules(config, testInfo);
Map<String, ITestSuite> moduleMapping = new HashMap<>();
for (ITestSuite test : allModules) {
@@ -206,7 +211,7 @@ public class DynamicShardHelper extends StrictShardHelper {
Collection<IRemoteTest> splitSuite = suite.split(1000000, testInfo);
if (splitSuite == null) {
- allTests.add(suite);
+ return null;
} else {
allTests.addAll(
splitSuite.stream()