Skip to content

Commit ec2ab54

Browse files
authored
Switch flutter_build_apk_health_tests to use a subset of current tests. (flutter#159004)
Towards flutter#159000 as part of debugging issues such as flutter#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).
1 parent 4d3bbf3 commit ec2ab54

13 files changed

+45
-96
lines changed

dev/bots/test.dart

+5-6
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,15 @@ 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'))
240-
.listSync(recursive: true).whereType<File>()
241-
.map<String>((FileSystemEntity entry) => path.relative(entry.path, from: _toolsPath))
242-
.where((String testPath) => path.basename(testPath).endsWith('_test.dart')).toList();
243-
244239
await runDartTest(
245240
_toolsPath,
246241
forceSingleCore: true,
247-
testPaths: selectIndexOfTotalSubshard<String>(allTests),
242+
testPaths: <String>[
243+
path.join(_toolsPath, 'test', 'integration.shard'),
244+
],
248245
collectMetrics: true,
246+
runSkipped: true,
247+
tags: <String>['flutter-build-apk'],
249248
);
250249
}
251250

dev/bots/utils.dart

+6
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ Future<void> runDartTest(String workingDirectory, {
342342
bool ensurePrecompiledTool = true,
343343
bool shuffleTests = true,
344344
bool collectMetrics = false,
345+
List<String>? tags,
346+
bool runSkipped = false,
345347
}) async {
346348
int? cpus;
347349
final String? cpuVariable = Platform.environment['CPU']; // CPU is set in cirrus.yml
@@ -379,6 +381,10 @@ Future<void> runDartTest(String workingDirectory, {
379381
'--coverage=$coverage',
380382
if (perTestTimeout != null)
381383
'--timeout=${perTestTimeout.inMilliseconds}ms',
384+
if (runSkipped)
385+
'--run-skipped',
386+
if (tags != null)
387+
...tags.map((String t) => '--tags=$t'),
382388
if (testPaths != null)
383389
for (final String testPath in testPaths)
384390
testPath,

packages/flutter_tools/test/flutter_build_apk.shard/README.md

-3
This file was deleted.

packages/flutter_tools/test/flutter_build_apk.shard/flutter_build_apk_test.dart

-87
This file was deleted.

packages/flutter_tools/test/integration.shard/android_e2e_api_test.dart

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
7+
library;
8+
59
import 'package:file/file.dart';
610
import 'package:flutter_tools/src/base/io.dart';
711

packages/flutter_tools/test/integration.shard/android_gradle_deprecated_plugin_apply_test.dart

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
7+
library;
8+
59
import 'dart:convert';
610

711
import 'package:file/file.dart';

packages/flutter_tools/test/integration.shard/android_gradle_legacy_flutter_plugins_strings_in_comments_test.dart

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
7+
library;
8+
59
// This test can be removed once https://github.com/flutter/flutter/issues/155484 is resolved.
610

711
import 'package:flutter_tools/src/base/file_system.dart';

packages/flutter_tools/test/integration.shard/android_gradle_print_build_variants_test.dart

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
7+
library;
8+
59
import 'dart:convert';
610

711
import 'package:collection/collection.dart';

packages/flutter_tools/test/integration.shard/android_plugin_example_app_build_test.dart

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
7+
library;
8+
59
import 'package:file_testing/file_testing.dart';
610
import 'package:flutter_tools/src/base/file_system.dart';
711
import 'package:flutter_tools/src/base/io.dart';

packages/flutter_tools/test/integration.shard/flutter_build_with_compilation_error_test.dart

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
7+
library;
8+
59
import 'package:file/file.dart';
610
import 'package:flutter_tools/src/base/io.dart';
711

packages/flutter_tools/test/integration.shard/isolated/native_assets_agp_version_test.dart

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
57
@Timeout(Duration(minutes: 10))
68
library;
79

packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
// contain the native assets mapping.
1111
// When doing a hot reload, this mapping must stay in place.
1212

13+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
14+
@Tags(<String>['flutter-build-apk'])
1315
@Timeout(Duration(minutes: 10))
1416
library;
1517

@@ -224,6 +226,7 @@ void main() {
224226
// TODO(matanlurey): Debug why flutter build apk often timesout.
225227
// See https://github.com/flutter/flutter/issues/158560 for details.
226228
skip: buildSubcommand == 'apk' ? 'flutter build apk times out' : false, // Temporary workaround for https://github.com/flutter/flutter/issues/158560.
229+
tags: <String>['flutter-build-apk'],
227230
);
228231
}
229232
}

packages/flutter_tools/test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
// TODO(matanlurey): Remove after debugging https://github.com/flutter/flutter/issues/159000.
6+
@Tags(<String>['flutter-build-apk'])
7+
library;
8+
59
import 'dart:io' as io;
610

711
import 'package:file/file.dart';
@@ -143,6 +147,7 @@ void main(List<String> args) async {
143147
// TODO(matanlurey): Debug why flutter build apk often timesout.
144148
// See https://github.com/flutter/flutter/issues/158560 for details.
145149
skip: buildCommand == 'apk' ? 'flutter build apk times out' : false, // Temporary workaround for https://github.com/flutter/flutter/issues/158560.
150+
tags: <String>['flutter-build-apk'],
146151
);
147152
}
148153

0 commit comments

Comments
 (0)