Skip to content

Commit 0301c8d

Browse files
authored
Try to be more consistent about deleting test apps in devicelab logic. (#146856)
Fixes flutter/flutter#137555.
1 parent cf26b11 commit 0301c8d

22 files changed

+66
-22
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/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
}

dev/devicelab/lib/tasks/android_views_test.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ TaskFunction androidViewsTest({
3434
final int exitCode = await exec(
3535
'./gradlew',
3636
<String>['-q', 'dependencies'],
37-
workingDirectory:
38-
'${flutterDirectory.path}/dev/integration_tests/android_views/android'
37+
workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views/android'
3938
);
4039
if (exitCode != 0) {
4140
return TaskResult.failure('Failed to download gradle dependencies');
@@ -51,6 +50,12 @@ TaskFunction androidViewsTest({
5150
environment: environment,
5251
workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views'
5352
);
53+
await flutter(
54+
'install',
55+
options: <String>['--uninstall-only'],
56+
environment: environment,
57+
workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views',
58+
);
5459
return TaskResult.success(null);
5560
};
5661
}

0 commit comments

Comments
 (0)