From 7ec50ddd66fa3166be08b779a4b5ba388a50ab24 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 29 Apr 2020 12:51:38 -0700 Subject: [PATCH] [devicelab] Explicitly print stack trace from error in android attach test (#55981) --- dev/devicelab/bin/tasks/flutter_attach_test_android.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/devicelab/bin/tasks/flutter_attach_test_android.dart b/dev/devicelab/bin/tasks/flutter_attach_test_android.dart index 212715a4e7..d21e119ebd 100644 --- a/dev/devicelab/bin/tasks/flutter_attach_test_android.dart +++ b/dev/devicelab/bin/tasks/flutter_attach_test_android.dart @@ -57,7 +57,9 @@ Future testReload(Process process, { Future Function() onListening } event, process.exitCode, // Keep the test from running for 15 minutes if it gets stuck. - Future.delayed(const Duration(seconds: 10)), + Future.delayed(const Duration(seconds: 10)).then((void _) { + throw StateError('eventOrExit timed out'); + }), ]); } @@ -71,10 +73,12 @@ Future testReload(Process process, { Future Function() onListening } print('run:stdin: r'); await process.stdin.flush(); await eventOrExit(reloaded.future); + process.stdin.write('R'); print('run:stdin: R'); await process.stdin.flush(); await eventOrExit(restarted.future); + process.stdin.write('q'); print('run:stdin: q'); await process.stdin.flush(); @@ -168,6 +172,9 @@ void main() { ); // Verify that it can discover the observatory port from past logs. await testReload(attachProcess); + } catch (err, st) { + print('Uncaught exception: $err\n$st'); + rethrow; } finally { section('Uninstalling'); await device.adb(['uninstall', kAppId]);