Skip to content

Commit fb7e8b0

Browse files
authored
Try to be more consistent about deleting test apps in devicelab logic (#146931)
Fixes #137555. This is an updated version of flutter/flutter#146856, which was reverted in flutter/flutter#146927. The first commit is identical to the original PR, and subsequent commits are the fixes to address failures detected in devicelab post-commit.
1 parent 72b4b29 commit fb7e8b0

23 files changed

+74
-34
lines changed

dev/devicelab/bin/tasks/complex_layout_semantics_perf.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ void main() {
3232
'-d',
3333
deviceId,
3434
]);
35+
await device.uninstallApp();
3536
});
3637

3738
final String outputPath = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? p.join(complexLayoutPath, 'build');

dev/devicelab/bin/tasks/drive_perf_debug_warning.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Future<String> _runWithMode(String mode, String deviceId) async {
1616
'-d',
1717
deviceId,
1818
]);
19+
await evalFlutter('install', options: <String>['--uninstall-only', '-d', deviceId]);
1920
return stderr.toString();
2021
}
2122

dev/devicelab/bin/tasks/hello_world__memory.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class HelloWorldMemoryTest extends MemoryTest {
2929
await recordStart();
3030
await Future<void>.delayed(const Duration(milliseconds: 3000));
3131
await recordEnd();
32+
await device!.uninstallApp();
3233
}
3334
}
3435

dev/devicelab/bin/tasks/hello_world_impeller.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Future<TaskResult> run() async {
6565
await Future<void>.delayed(const Duration(seconds: 30));
6666
process.stdin.write('q');
6767
await adb.cancel();
68+
await device.uninstallApp();
6869
});
6970

7071
if (!isUsingValidationLayers || impellerBackendCount != 1) {

dev/devicelab/bin/tasks/platform_channels_benchmarks.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ import 'package:flutter_devicelab/framework/framework.dart' show task;
77
import 'package:flutter_devicelab/tasks/platform_channels_benchmarks.dart' as platform_channels_benchmarks;
88

99
Future<void> main() async {
10-
await task(
11-
platform_channels_benchmarks.runTask(DeviceOperatingSystem.android));
10+
await task(platform_channels_benchmarks.runTask(DeviceOperatingSystem.android));
1211
}

dev/devicelab/bin/tasks/route_test_ios.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ void main() {
1616
final Device device = await devices.workingDevice;
1717
await device.unlock();
1818
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
19-
section('TEST WHETHER `flutter drive --route` WORKS on IOS');
19+
section('TEST WHETHER `flutter drive --route` WORKS ON iOS');
2020
await inDirectory(appDir, () async {
21-
return flutter(
21+
await flutter(
2222
'drive',
2323
options: <String>[
2424
'--verbose',
@@ -29,6 +29,7 @@ void main() {
2929
'lib/route.dart',
3030
],
3131
);
32+
await device.uninstallApp();
3233
});
3334
return TaskResult.success(null);
3435
});

dev/devicelab/bin/tasks/service_extensions_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ void main() {
118118
if (result != 0) {
119119
throw 'Received unexpected exit code $result from run process.';
120120
}
121+
await device.uninstallApp();
121122
});
122123
return TaskResult.success(null);
123124
});

dev/devicelab/lib/tasks/android_choreographer_do_frame_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ Future<void> main() async {
161161
await stderr.cancel();
162162
run.kill();
163163

164+
await inDirectory(path.join(tempDir.path, 'app'), () async {
165+
await flutter(
166+
'install',
167+
options: <String>['--uninstall-only'],
168+
);
169+
});
170+
164171
if (nextCompleterIdx == sentinelCompleters.values.length) {
165172
return TaskResult.success(null);
166173
}

dev/devicelab/lib/tasks/android_lifecycles_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ void main() {
154154
await lifecycles.close();
155155
await stdout.cancel();
156156
await stderr.cancel();
157+
158+
await inDirectory(path.join(tempDir.path, 'app'), () async {
159+
await flutter(
160+
'install',
161+
options: <String>['--uninstall-only'],
162+
);
163+
});
157164
return TaskResult.success(null);
158165
}
159166

dev/devicelab/lib/tasks/android_verified_input_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class DriverTest {
5353
...extraOptions,
5454
];
5555
await flutter('drive', options: options, environment: environment);
56-
56+
await flutter('install', options: <String>['--uninstall-only', '-d', deviceId], environment: environment);
5757
return TaskResult.success(null);
5858
});
5959
}

0 commit comments

Comments
 (0)