Skip to content

Commit a757154

Browse files
jensjohaCommit Queue
authored andcommitted
[infra] Shard dart2js modular tests
* Shard dart2js modular tests (and decrease the shards of the unit tests) * Remove folders we look for dart files in --- the remove folders doesn't contain any anyway and would have to be copied if keeping these lines. * Fix sharding, previously trying to shard in 2 shards would only allow you to run ~50% of the tests: ``` $ out/ReleaseX64/dart-sdk/bin/dart pkg/compiler/tool/modular_test_suite.dart -nweb-unittest-asserts-linux --verbose --use-sdk --shards=2 --shard=0 Error: shard should be between 0 and 1, but got 0 $ out/ReleaseX64/dart-sdk/bin/dart pkg/compiler/tool/modular_test_suite.dart -nweb-unittest-asserts-linux --verbose --use-sdk --shards=2 --shard=2 Error: shard should be between 0 and 1, but got 2 ``` This has been corrected to allow from `1..n` for `n` shards to fit with what the testing system sends when specifying `shards` in `tools/bots/test_matrix.json`. For previous try runs I extracted this: Build 60615: Shard #1: --- Total time: 04:27 --- Shard #2: --- Total time: 05:19 --- Shard #3: --- Total time: 04:23 --- Shard #4: --- Total time: 10:29 --- => A total of 24:35 --- combined finish of 10:29 Modular tests: 32:19 Total bot runtime: 35:48 Build 60614: Shard #1: --- Total time: 03:57 --- Shard #2: --- Total time: 05:18 --- Shard #3: --- Total time: 05:21 --- Shard #4: --- Total time: 05:34 --- => A total of 20:10 --- combined finish of 5:34 Modular tests: 29:41 secs Total bot runtime: 35:55 Build: 60613 Shard #1: --- Total time: 03:56 --- Shard #2: --- Total time: 05:15 --- Shard #3: --- Total time: 04:32 --- Shard #4: --- Total time: 05:34 --- => A total of 19:17 --- combined finish of 5:34 Modular tests: 33:39 Total bot runtime: 38:51 With the new sharding I'd estimate that the unit tests and modular tests would have finished in less than 13 minutes, making the bots finish in ~17 minutes, ~20 minutes and ~19 minutes instead. The try-run with this ran in 17:06 Possibly a follow-up could do more stuff on the "main bot". Change-Id: Ie5c96206deb9c0c6db3385bbca04ae6f4eab4c3a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/448381 Reviewed-by: Nate Biggs <[email protected]> Reviewed-by: Ivan Inozemtsev <[email protected]> Commit-Queue: Jens Johansen <[email protected]>
1 parent c27605e commit a757154

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

pkg/modular_test/lib/src/loader.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ Future<Module> _createSdkModule(Uri root) async {
193193
// it doesn't list files that are transitively imported.
194194
var sdkLibrariesAndPatchesRoots = [
195195
'sdk/lib/',
196-
'runtime/lib/',
197-
'runtime/bin/',
198196
];
199197
for (var path in sdkLibrariesAndPatchesRoots) {
200198
var dir = Directory.fromUri(root.resolve(path));

pkg/modular_test/lib/src/runner.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class Options {
8787
help: 'total number of shards a suite is going to be split into.',
8888
defaultsTo: '1')
8989
..addOption('shard',
90-
help: 'which shard this script is executing. This should be between 0'
91-
' and `shards - 1`.')
90+
help: 'which shard this script is executing. This should be between 1'
91+
' and `shards`.')
9292
..addOption('output-directory',
9393
help: 'location where to emit the jsonl result and log files')
9494
..addOption('named-configuration',
@@ -99,8 +99,8 @@ class Options {
9999
int shard = 1;
100100
if (shards > 1) {
101101
shard = int.tryParse(argResults['shard']) ?? 1;
102-
if (shard <= 0 || shard >= shards) {
103-
print('Error: shard should be between 0 and ${shards - 1},'
102+
if (shard <= 0 || shard > shards) {
103+
print('Error: shard should be between 1 and $shards,'
104104
' but got $shard');
105105
exit(1);
106106
}
@@ -112,7 +112,8 @@ class Options {
112112
..useSdk = argResults['use-sdk']
113113
..filter = argResults['filter']
114114
..shards = shards
115-
..shard = shard
115+
// Turn shard from [1..shards] into [0..shards-1]
116+
..shard = shard - 1
116117
..configurationName = argResults['named-configuration']
117118
..outputDirectory = toUri(argResults['output-directory']);
118119
}

tools/bots/test_matrix.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"tests/ffi/",
3535
"tests/language/",
3636
"tests/lib/",
37+
"tests/modular/",
3738
"tests/web/",
3839
"third_party/d8/",
3940
"third_party/pkg/",
@@ -2493,7 +2494,7 @@
24932494
"-nweb-unittest-asserts-linux",
24942495
"pkg//compiler/"
24952496
],
2496-
"shards": 4,
2497+
"shards": 2,
24972498
"fileset": "js_platform"
24982499
},
24992500
{
@@ -2505,7 +2506,9 @@
25052506
"-nweb-unittest-asserts-linux",
25062507
"--verbose",
25072508
"--use-sdk"
2508-
]
2509+
],
2510+
"shards": 3,
2511+
"fileset": "js_platform"
25092512
},
25102513
{
25112514
"name": "js_runtime unit tests",

0 commit comments

Comments
 (0)