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 https://github.com/flutter/flutter/issues/158560.
This commit is contained in:
Matan Lurey 2024-11-14 16:45:50 -08:00 committed by GitHub
parent d0bd283734
commit 57b0b02e4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 2 deletions

View File

@ -236,7 +236,8 @@ Future<void> _runIntegrationToolTests() async {
} }
Future<void> _runFlutterBuildApkHealthTests() async { Future<void> _runFlutterBuildApkHealthTests() async {
final List<String> allTests = Directory(path.join(_toolsPath, 'test', 'flutter_build_apk.shard')) // Try "priming" the test environment by running historically problematic tests first.
final List<String> toolIntegrationTests = Directory(path.join(_toolsPath, 'test', 'integration.shard'))
.listSync(recursive: true).whereType<File>() .listSync(recursive: true).whereType<File>()
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath)) .map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList(); .where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
@ -244,7 +245,21 @@ Future<void> _runFlutterBuildApkHealthTests() async {
await runDartTest( await runDartTest(
_toolsPath, _toolsPath,
forceSingleCore: true, forceSingleCore: true,
testPaths: selectIndexOfTotalSubshard<String>(allTests), testPaths: selectIndexOfTotalSubshard<String>(toolIntegrationTests, subshardKey: '6_6'),
collectMetrics: true,
runSkipped: true,
);
// Then run the health tests after.
final List<String> flutterBuildApkTests = 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>(flutterBuildApkTests),
collectMetrics: true, collectMetrics: true,
); );
} }

View File

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