restore quit timeout, adjust some integration test behaviors (#55812)
This commit is contained in:
@@ -53,7 +53,12 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
|
||||
process.exitCode.then<void>((int processExitCode) { exitCode = processExitCode; });
|
||||
|
||||
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);
|
||||
@@ -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.');
|
||||
|
||||
process.stdin.write('r');
|
||||
process.stdin.flush();
|
||||
print('run:stdin: r');
|
||||
await process.stdin.flush();
|
||||
await eventOrExit(reloaded.future);
|
||||
process.stdin.write('R');
|
||||
process.stdin.flush();
|
||||
print('run:stdin: R');
|
||||
await process.stdin.flush();
|
||||
await eventOrExit(restarted.future);
|
||||
process.stdin.write('q');
|
||||
process.stdin.flush();
|
||||
print('run:stdin: q');
|
||||
await process.stdin.flush();
|
||||
await eventOrExit(finished.future);
|
||||
|
||||
await process.exitCode;
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user