Skip to content

Commit

Permalink
Reverts "Try to be more consistent about deleting test apps in device…
Browse files Browse the repository at this point in the history
…lab logic. (#146856)" (#146927)

Reverts: flutter/flutter#146856
Initiated by: Hixie
Reason for reverting: breaking tree
Original PR Author: Hixie

Reviewed By: {reidbaker}

This change reverts the following previous change:
Fixes flutter/flutter#137555.
  • Loading branch information
auto-submit[bot] authored Apr 17, 2024
1 parent f02cb0c commit f8c3e52
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 66 deletions.
1 change: 0 additions & 1 deletion dev/devicelab/bin/tasks/complex_layout_semantics_perf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ void main() {
'-d',
deviceId,
]);
await device.uninstallApp();
});

final String outputPath = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? p.join(complexLayoutPath, 'build');
Expand Down
1 change: 0 additions & 1 deletion dev/devicelab/bin/tasks/drive_perf_debug_warning.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Future<String> _runWithMode(String mode, String deviceId) async {
'-d',
deviceId,
]);
await evalFlutter('install', options: <String>['--uninstall-only', '-d', deviceId]);
return stderr.toString();
}

Expand Down
1 change: 0 additions & 1 deletion dev/devicelab/bin/tasks/hello_world__memory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class HelloWorldMemoryTest extends MemoryTest {
await recordStart();
await Future<void>.delayed(const Duration(milliseconds: 3000));
await recordEnd();
await device!.uninstallApp();
}
}

Expand Down
1 change: 0 additions & 1 deletion dev/devicelab/bin/tasks/hello_world_impeller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Future<TaskResult> run() async {
await Future<void>.delayed(const Duration(seconds: 30));
process.stdin.write('q');
await adb.cancel();
await device.uninstallApp();
});

if (!isUsingValidationLayers || impellerBackendCount != 1) {
Expand Down
5 changes: 2 additions & 3 deletions dev/devicelab/bin/tasks/route_test_ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ void main() {
final Device device = await devices.workingDevice;
await device.unlock();
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
section('TEST WHETHER `flutter drive --route` WORKS ON iOS');
section('TEST WHETHER `flutter drive --route` WORKS on IOS');
await inDirectory(appDir, () async {
await flutter(
return flutter(
'drive',
options: <String>[
'--verbose',
Expand All @@ -29,7 +29,6 @@ void main() {
'lib/route.dart',
],
);
await device.uninstallApp();
});
return TaskResult.success(null);
});
Expand Down
1 change: 0 additions & 1 deletion dev/devicelab/bin/tasks/service_extensions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ void main() {
if (result != 0) {
throw 'Received unexpected exit code $result from run process.';
}
await device.uninstallApp();
});
return TaskResult.success(null);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,6 @@ Future<void> main() async {
await stderr.cancel();
run.kill();

await inDirectory(path.join(tempDir.path, 'app'), () async {
await flutter(
'install',
options: <String>['--uninstall-only'],
);
});

if (nextCompleterIdx == sentinelCompleters.values.length) {
return TaskResult.success(null);
}
Expand Down
7 changes: 0 additions & 7 deletions dev/devicelab/lib/tasks/android_lifecycles_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ void main() {
await lifecycles.close();
await stdout.cancel();
await stderr.cancel();

await inDirectory(path.join(tempDir.path, 'app'), () async {
await flutter(
'install',
options: <String>['--uninstall-only'],
);
});
return TaskResult.success(null);
}

Expand Down
2 changes: 1 addition & 1 deletion dev/devicelab/lib/tasks/android_verified_input_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DriverTest {
...extraOptions,
];
await flutter('drive', options: options, environment: environment);
await flutter('install', options: <String>['--uninstall-only', '-d', deviceId], environment: environment);

return TaskResult.success(null);
});
}
Expand Down
9 changes: 2 additions & 7 deletions dev/devicelab/lib/tasks/android_views_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ TaskFunction androidViewsTest({
final int exitCode = await exec(
'./gradlew',
<String>['-q', 'dependencies'],
workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views/android'
workingDirectory:
'${flutterDirectory.path}/dev/integration_tests/android_views/android'
);
if (exitCode != 0) {
return TaskResult.failure('Failed to download gradle dependencies');
Expand All @@ -50,12 +51,6 @@ TaskFunction androidViewsTest({
environment: environment,
workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views'
);
await flutter(
'install',
options: <String>['--uninstall-only'],
environment: environment,
workingDirectory: '${flutterDirectory.path}/dev/integration_tests/android_views',
);
return TaskResult.success(null);
};
}
3 changes: 2 additions & 1 deletion dev/devicelab/lib/tasks/build_test_task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ abstract class BuildTestTask {
await flutter('build', options: getBuildArgs(deviceOperatingSystem));
copyArtifacts();
});

}

/// Run Flutter drive test from [getTestArgs] against the application under test on the device.
Expand All @@ -73,7 +74,7 @@ abstract class BuildTestTask {
section('DRIVE START');
await flutter('drive', options: getTestArgs(deviceOperatingSystem, device.deviceId));
});
await device.uninstallApp();

return parseTaskResult();
}

Expand Down
18 changes: 6 additions & 12 deletions dev/devicelab/lib/tasks/dart_plugin_registry_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,12 @@ class ApluginPlatformInterfaceMacOS {
pluginImplPubspecContent = pluginImplPubspecContent.replaceFirst(
' pluginClass: ApluginPlatformImplementationPlugin',
' pluginClass: ApluginPlatformImplementationPlugin\n'
' dartPluginClass: ApluginPlatformInterfaceMacOS\n',
' dartPluginClass: ApluginPlatformInterfaceMacOS\n',
);
pluginImplPubspecContent = pluginImplPubspecContent.replaceFirst(
' platforms:\n',
' implements: aplugin_platform_interface\n'
' platforms:\n',
);
' platforms:\n');
await pluginImplPubspec.writeAsString(pluginImplPubspecContent,
flush: true);

Expand Down Expand Up @@ -105,8 +104,8 @@ class ApluginPlatformInterfaceMacOS {
pluginInterfacePubspecContent.replaceFirst(
'dependencies:',
'dependencies:\n'
' aplugin_platform_implementation:\n'
' path: ../aplugin_platform_implementation\n');
' aplugin_platform_implementation:\n'
' path: ../aplugin_platform_implementation\n');
await pluginInterfacePubspec.writeAsString(pluginInterfacePubspecContent,
flush: true);

Expand Down Expand Up @@ -136,8 +135,8 @@ class ApluginPlatformInterfaceMacOS {
appPubspecContent = appPubspecContent.replaceFirst(
'dependencies:',
'dependencies:\n'
' aplugin_platform_interface:\n'
' path: ../aplugin_platform_interface\n');
' aplugin_platform_interface:\n'
' path: ../aplugin_platform_interface\n');
await appPubspec.writeAsString(appPubspecContent, flush: true);

section('Flutter run for macos');
Expand Down Expand Up @@ -208,11 +207,6 @@ class ApluginPlatformInterfaceMacOS {
unawaited(stdoutSub.cancel());
unawaited(stderrSub.cancel());

await flutter(
'install',
options: <String>['--uninstall-only', '-d', 'macos'],
);

return TaskResult.success(null);
} finally {
rmTree(tempDir);
Expand Down
1 change: 0 additions & 1 deletion dev/devicelab/lib/tasks/entrypoint_dart_registrant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ Future<TaskResult> _runWithTempDir(Directory tempDir) async {
process.stdin.write('q');
await process.stdin.flush();
process.kill(ProcessSignal.sigint);
await device.uninstallApp();
return entrypoint;
});
if (entrypoint.contains('$_messagePrefix $_entrypointName')) {
Expand Down
2 changes: 1 addition & 1 deletion dev/devicelab/lib/tasks/gallery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ TaskFunction createGalleryTransitionHybridTest({bool semanticsEnabled = false})
}

class GalleryTransitionTest {

GalleryTransitionTest({
this.semanticsEnabled = false,
this.testFile = 'transitions_perf',
Expand Down Expand Up @@ -153,7 +154,6 @@ class GalleryTransitionTest {
'-v',
'--verbose-system-logs'
]);
await flutter('install', options: <String>['--uninstall-only', '-d', deviceId]);
});

final String testOutputDirectory = Platform.environment['FLUTTER_TEST_OUTPUTS_DIR'] ?? '${galleryDirectory.path}/build';
Expand Down
2 changes: 0 additions & 2 deletions dev/devicelab/lib/tasks/hot_mode_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ TaskFunction createHotModeTest({
<Future<void>>[stdoutDone.future, stderrDone.future]);
await process.exitCode;

await flutter('install', options: <String>['--uninstall-only', '-d', deviceIdOverride!]);

freshRestartReloadsData =
json.decode(benchmarkFile.readAsStringSync()) as Map<String, dynamic>;
}
Expand Down
3 changes: 1 addition & 2 deletions dev/devicelab/lib/tasks/integration_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class DriverTest {
...extraOptions,
];
await flutter('drive', options: options, environment: environment);
await flutter('install', options: <String>['--uninstall-only', '-d', deviceId], environment: environment);

return TaskResult.success(null);
});
}
Expand Down Expand Up @@ -267,7 +267,6 @@ class IntegrationTest {
if (withTalkBack) {
await disableTalkBack();
}
await flutter('install', options: <String>['--uninstall-only', '-d', deviceId], environment: environment);

return TaskResult.success(null);
});
Expand Down
4 changes: 1 addition & 3 deletions dev/devicelab/lib/tasks/microbenchmarks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ TaskFunction createMicrobenchmarkTask({
environment: environment,
);
});
final Future<Map<String, double>> result = readJsonResults(flutterProcess);
await device.uninstallApp();
return result;
return readJsonResults(flutterProcess);
}

return run();
Expand Down
1 change: 0 additions & 1 deletion dev/devicelab/lib/tasks/native_assets_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ TaskFunction createNativeAssetsTest({
if (runFlutterResult != 0) {
print('Flutter run returned non-zero exit code: $runFlutterResult.');
}
await flutter('install', options: <String>['--uninstall-only', '-d', deviceIdOverride!]);
});

final int expectedNumberOfTransitions = buildMode == 'debug' ? 4 : 1;
Expand Down
13 changes: 4 additions & 9 deletions dev/devicelab/lib/tasks/perf_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1245,10 +1245,9 @@ class PerfTest {
/// If null, the device is selected depending on the current environment.
final Device? device;

/// The function called instead of the actual `flutter drive`.
/// The function called instead of the actually `flutter drive`.
///
/// If it is not `null`, `flutter drive` and `flutter install --uninstall-only`
/// will not happen in the PerfTests.
/// If it is not `null`, `flutter drive` will not happen in the PerfTests.
final FlutterDriveCallback? flutterDriveCallback;

/// Whether the perf test should enable Impeller.
Expand All @@ -1261,8 +1260,6 @@ class PerfTest {
final bool disablePartialRepaint;

/// Number of seconds to time out the test after, allowing debug callbacks to run.
///
/// Passed to `--timeout`.
final int? timeoutSeconds;

/// The keys of the values that need to be reported.
Expand Down Expand Up @@ -1396,7 +1393,6 @@ class PerfTest {
flutterDriveCallback!(options);
} else {
await flutter('drive', options: options);
await flutter('install', options: <String>['--uninstall-only', '-d', deviceId]);
}
} finally {
await resetManifest();
Expand Down Expand Up @@ -2131,8 +2127,6 @@ class DevToolsMemoryTest {
}
}

await _device.uninstallApp();

return TaskResult.success(
<String, dynamic>{'maxRss': maxRss, 'maxAdbTotal': maxAdbTotal},
benchmarkScoreKeys: <String>['maxRss', 'maxAdbTotal'],
Expand Down Expand Up @@ -2205,12 +2199,13 @@ class ReportedDurationTest {
await device!.stop(package);
await adb.cancel();

await device!.uninstallApp();
_device = null;

final Map<String, dynamic> reportedDuration = <String, dynamic>{
'duration': duration,
};
_device = null;

return TaskResult.success(reportedDuration, benchmarkScoreKeys: reportedDuration.keys.toList());
});
}
Expand Down
1 change: 0 additions & 1 deletion dev/devicelab/lib/tasks/platform_channels_benchmarks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ TaskFunction runTask(adb.DeviceOperatingSystem operatingSystem) {

final Map<String, double> results =
await microbenchmarks.readJsonResults(flutterProcess);
await device.uninstallApp();
return TaskResult.success(results,
benchmarkScoreKeys: results.keys.toList());
};
Expand Down
4 changes: 1 addition & 3 deletions dev/devicelab/lib/tasks/run_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class AndroidRunOutputTest extends RunOutputTask {

@override
bool isExpectedStderr(String line) {
// TODO(egarciad): Remove (because https://github.com/flutter/flutter/issues/95131 is now fixed)
// TODO(egarciad): Remove once https://github.com/flutter/flutter/issues/95131 is fixed.
return line.contains('Mapping new ns');
}

Expand Down Expand Up @@ -321,8 +321,6 @@ abstract class RunOutputTask {

await run.exitCode;

await device.uninstallApp();

if (stderr.isNotEmpty) {
throw 'flutter run ${release ? '--release' : ''} had unexpected output on standard error.';
}
Expand Down
1 change: 1 addition & 0 deletions dev/devicelab/lib/tasks/web_dev_mode_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ TaskFunction createWebDevModeTest(String webDevice, bool enableIncrementalCompil
// Start `flutter run` again to make sure it loads from the previous
// state. dev compilers loads up from previously compiled JavaScript.
{

final Stopwatch sw = Stopwatch()..start();
final Process process = await startFlutter(
'run',
Expand Down

0 comments on commit f8c3e52

Please sign in to comment.