Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: runtime/observatory/tests/service/test_helper.dart

Issue 2343183002: Fix service test websocket error edge case (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
});
});
}
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698