Switch flutter_build_apk_health_tests to use a subset of current tests. (#159004)

Towards https://github.com/flutter/flutter/issues/159000 as part of
debugging issues such as
https://github.com/flutter/flutter/issues/158560.

On a `bringup: true` shard, run a number of `flutter build apk` tests in
succession to try and routinely trigger timeouts and crashes, so we can
test other hypotheses on how to fix this problem (i.e. potentially
around increasing memory, changing daemon configuration, aggressively
killing processes, etc).
This commit is contained in:
Matan Lurey
2024-11-15 14:54:06 -08:00
committed by GitHub
parent 4d3bbf30c8
commit ec2ab541dd
13 changed files with 45 additions and 96 deletions

View File

@@ -236,16 +236,15 @@ Future<void> _runIntegrationToolTests() async {
}
Future<void> _runFlutterBuildApkHealthTests() async {
final List<String> allTests = Directory(path.join(_toolsPath, 'test', 'flutter_build_apk.shard'))
.listSync(recursive: true).whereType<File>()
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
await runDartTest(
_toolsPath,
forceSingleCore: true,
testPaths: selectIndexOfTotalSubshard<String>(allTests),
testPaths: <String>[
path.join(_toolsPath, 'test', 'integration.shard'),
],
collectMetrics: true,
runSkipped: true,
tags: <String>['flutter-build-apk'],
);
}

View File

@@ -342,6 +342,8 @@ Future<void> runDartTest(String workingDirectory, {
bool ensurePrecompiledTool = true,
bool shuffleTests = true,
bool collectMetrics = false,
List<String>? tags,
bool runSkipped = false,
}) async {
int? cpus;
final String? cpuVariable = Platform.environment['CPU']; // CPU is set in cirrus.yml
@@ -379,6 +381,10 @@ Future<void> runDartTest(String workingDirectory, {
'--coverage=$coverage',
if (perTestTimeout != null)
'--timeout=${perTestTimeout.inMilliseconds}ms',
if (runSkipped)
'--run-skipped',
if (tags != null)
...tags.map((String t) => '--tags=$t'),
if (testPaths != null)
for (final String testPath in testPaths)
testPath,