| Index: runtime/observatory/tests/service/test_helper.dart
|
| diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
|
| index 6897588099212ec5b54fa3c9bc842c06f08ad947..858a23314eed7fd4fe62ffca200dd2792dfac1af 100644
|
| --- a/runtime/observatory/tests/service/test_helper.dart
|
| +++ b/runtime/observatory/tests/service/test_helper.dart
|
| @@ -16,11 +16,6 @@ import 'service_test_common.dart';
|
| String serviceHttpAddress;
|
| String serviceWebsocketAddress;
|
|
|
| -bool _isWebSocketDisconnect(e) {
|
| - return e is NetworkRpcException;
|
| -}
|
| -
|
| -
|
| const String _TESTEE_ENV_KEY = 'SERVICE_TEST_TESTEE';
|
| const Map<String, String> _TESTEE_SPAWN_ENV = const {
|
| _TESTEE_ENV_KEY: 'true'
|
| @@ -303,11 +298,8 @@ class _FlutterDeviceServiceTesterRunner {
|
| await test(isolate);
|
| }
|
| }
|
| - }, onError: (e, st) {
|
| - if (!_isWebSocketDisconnect(e)) {
|
| - print('Unexpected exception in service tests: $e $st');
|
| - throw e;
|
| - }
|
| + }, onError: (error, stackTrace) {
|
| + print('Unexpected exception in service tests: $error\n$stackTrace');
|
| });
|
| }
|
| }
|
| @@ -372,19 +364,10 @@ class _ServiceTesterRunner {
|
| }
|
|
|
| await process.requestExit();
|
| - }, onError: (e, st) {
|
| + }, onError: (error, stackTrace) {
|
| process.requestExit();
|
| - // TODO: remove this workaround.
|
| - // This is necessary due to non awaited operations.
|
| - // E.G. object.dart (398~402)
|
| - // When an exception is thrown inside a test (directly or via await) the
|
| - // stacktrace is non-null and shows where the exception has been thrown.
|
| - // If vice versa the exception is due to an error in a non-awaited
|
| - // Future the stacktrace is null.
|
| - if (st != null || !_isWebSocketDisconnect(e)) {
|
| - print('Unexpected exception in service tests: $e $st');
|
| - throw e;
|
| - }
|
| + print('Unexpected exception in service tests: $error\n$stackTrace');
|
| + throw error;
|
| });
|
| });
|
| }
|
|
|