Skip to content

Commit 57b0b02

Browse files
authored
Try running historically flaky tests first to make flutter build apk health tests time out more often? (#158967)
I have no idea if this will work, but `6_6` is currently the suite that seems to have the most problems. Towards flutter/flutter#158560.
1 parent d0bd283 commit 57b0b02

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

dev/bots/test.dart

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,30 @@ Future<void> _runIntegrationToolTests() async {
236236
}
237237

238238
Future<void> _runFlutterBuildApkHealthTests() async {
239-
final List<String> allTests = Directory(path.join(_toolsPath, 'test', 'flutter_build_apk.shard'))
239+
// Try "priming" the test environment by running historically problematic tests first.
240+
final List<String> toolIntegrationTests = Directory(path.join(_toolsPath, 'test', 'integration.shard'))
240241
.listSync(recursive: true).whereType<File>()
241242
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
242243
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
243244

244245
await runDartTest(
245246
_toolsPath,
246247
forceSingleCore: true,
247-
testPaths: selectIndexOfTotalSubshard<String>(allTests),
248+
testPaths: selectIndexOfTotalSubshard<String>(toolIntegrationTests, subshardKey: '6_6'),
249+
collectMetrics: true,
250+
runSkipped: true,
251+
);
252+
253+
// Then run the health tests after.
254+
final List<String> flutterBuildApkTests = Directory(path.join(_toolsPath, 'test', 'flutter_build_apk.shard'))
255+
.listSync(recursive: true).whereType<File>()
256+
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
257+
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
258+
259+
await runDartTest(
260+
_toolsPath,
261+
forceSingleCore: true,
262+
testPaths: selectIndexOfTotalSubshard<String>(flutterBuildApkTests),
248263
collectMetrics: true,
249264
);
250265
}

dev/bots/utils.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ Future<void> runDartTest(String workingDirectory, {
342342
bool ensurePrecompiledTool = true,
343343
bool shuffleTests = true,
344344
bool collectMetrics = false,
345+
bool runSkipped = false,
345346
}) async {
346347
int? cpus;
347348
final String? cpuVariable = Platform.environment['CPU']; // CPU is set in cirrus.yml
@@ -379,6 +380,8 @@ Future<void> runDartTest(String workingDirectory, {
379380
'--coverage=$coverage',
380381
if (perTestTimeout != null)
381382
'--timeout=${perTestTimeout.inMilliseconds}ms',
383+
if (runSkipped)
384+
'--run-skipped',
382385
if (testPaths != null)
383386
for (final String testPath in testPaths)
384387
testPath,

0 commit comments

Comments
 (0)