Skip to content

Commit 0fe29f5

Browse files
authored
Raise an exception when invalid subshard name (#113222)
1 parent 563e0a4 commit 0fe29f5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

dev/bots/test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,7 @@ List<T> _selectIndexOfTotalSubshard<T>(List<T> tests, {String subshardKey = kSub
19721972
foundError(<String>[
19731973
'${red}Invalid subshard name "$subshardName". Expected format "[int]_[int]" ex. "1_3"',
19741974
]);
1975-
return <T>[];
1975+
throw Exception('Invalid subshard name: $subshardName');
19761976
}
19771977
// One-indexed.
19781978
final int index = int.parse(match.group(1)!);

dev/bots/test/test_test.dart

+8
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,13 @@ void main() {
144144
expectExitCode(result, 1);
145145
expect(result.stdout, contains('Invalid subshard name'));
146146
});
147+
148+
test('exits with code 255 when invalid SUBSHARD name', () async {
149+
final ProcessResult result = await runScript(
150+
<String, String>{'SHARD': kTestHarnessShardName, 'SUBSHARD': 'invalid_name'},
151+
);
152+
expectExitCode(result, 255);
153+
expect(result.stdout, contains('Invalid subshard name'));
154+
});
147155
});
148156
}

0 commit comments

Comments
 (0)