Simplify devicelab logic and fix tests (#139122)

- fix https://github.com/flutter/flutter/issues/53707 by having the test not expect a timeout but instead actually look for the retry message
- simplify the `--task` option to only accept task names rather than also accepting paths
- remove some obsolete options that referred to the manifest which no longer seems to exist
This commit is contained in:
Ian Hickson
2023-11-29 00:41:27 -08:00
committed by GitHub
parent c5328650f1
commit 5e216d44ca
6 changed files with 59 additions and 61 deletions

View File

@@ -171,7 +171,8 @@ Future<TaskResult> runTask(
final String taskExecutable = 'bin/tasks/$taskName.dart';
if (!file(taskExecutable).existsSync()) {
throw 'Executable Dart file not found: $taskExecutable';
print('Executable Dart file not found: $taskExecutable');
exit(1);
}
if (useEmulator) {
@@ -288,7 +289,13 @@ Future<ConnectionResult> _connectToRunnerIsolate(Uri vmServiceUri) async {
return ConnectionResult(client, isolate);
} catch (error) {
if (stopwatch.elapsed > const Duration(seconds: 10)) {
print('VM service still not ready after ${stopwatch.elapsed}: $error\nContinuing to retry...');
print(
'VM service still not ready. It is possible the target has failed.\n'
'Latest connection error:\n'
' $error\n'
'Continuing to retry...\n',
);
stopwatch.reset();
}
await Future<void>.delayed(const Duration(milliseconds: 50));
}