Unverified Commit c15aa874 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

restore quit timeout, adjust some integration test behaviors (#55812)

parent ffcf1db3
...@@ -53,7 +53,12 @@ Future<void> testReload(Process process, { Future<void> Function() onListening } ...@@ -53,7 +53,12 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
process.exitCode.then<void>((int processExitCode) { exitCode = processExitCode; }); process.exitCode.then<void>((int processExitCode) { exitCode = processExitCode; });
Future<dynamic> eventOrExit(Future<void> event) { Future<dynamic> eventOrExit(Future<void> event) {
return Future.any<dynamic>(<Future<dynamic>>[ event, process.exitCode ]); return Future.any<dynamic>(<Future<dynamic>>[
event,
process.exitCode,
// Keep the test from running for 15 minutes if it gets stuck.
Future<void>.delayed(const Duration(seconds: 10)),
]);
} }
await eventOrExit(listening.future); await eventOrExit(listening.future);
...@@ -63,13 +68,16 @@ Future<void> testReload(Process process, { Future<void> Function() onListening } ...@@ -63,13 +68,16 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
throw TaskResult.failure('Failed to attach to test app; command unexpected exited, with exit code $exitCode.'); throw TaskResult.failure('Failed to attach to test app; command unexpected exited, with exit code $exitCode.');
process.stdin.write('r'); process.stdin.write('r');
process.stdin.flush(); print('run:stdin: r');
await process.stdin.flush();
await eventOrExit(reloaded.future); await eventOrExit(reloaded.future);
process.stdin.write('R'); process.stdin.write('R');
process.stdin.flush(); print('run:stdin: R');
await process.stdin.flush();
await eventOrExit(restarted.future); await eventOrExit(restarted.future);
process.stdin.write('q'); process.stdin.write('q');
process.stdin.flush(); print('run:stdin: q');
await process.stdin.flush();
await eventOrExit(finished.future); await eventOrExit(finished.future);
await process.exitCode; await process.exitCode;
......
...@@ -286,7 +286,19 @@ class FlutterDevice { ...@@ -286,7 +286,19 @@ class FlutterDevice {
)); ));
} }
} }
return vmService.onDone; return vmService.onDone
.catchError((dynamic error, StackTrace stackTrace) {
globals.logger.printError(
'unhanlded error waiting for vm service exit:\n $error',
stackTrace: stackTrace,
);
})
.timeout(const Duration(seconds: 2), onTimeout: () {
// TODO(jonahwilliams): this only seems to fail on CI in the
// flutter_attach_android_test. This log should help verify this
// is where the tool is getting stuck.
globals.logger.printTrace('error: vm service shutdown failed');
});
} }
Future<Uri> setupDevFS( Future<Uri> setupDevFS(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment