Commit 466a91ab authored by Hixie's avatar Hixie

fix the 'dart:profiler' bug

...by requiring a new version of analyzer.

Also, when the subprocess is terminated unexpectedly, report the actual
problem in more detail.
parent 5978f135
...@@ -12,7 +12,7 @@ class JSONSocket { ...@@ -12,7 +12,7 @@ class JSONSocket {
final WebSocket _socket; final WebSocket _socket;
final Stream stream; final Stream stream;
final Future unusualTermination; final Future<String> unusualTermination;
void send(dynamic data) { void send(dynamic data) {
_socket.add(JSON.encode(data)); _socket.add(JSON.encode(data));
......
...@@ -90,7 +90,7 @@ void main() { ...@@ -90,7 +90,7 @@ void main() {
'''); ''');
Completer<Iterable<RemoteTest>> completer = new Completer<Iterable<RemoteTest>>(); Completer<Iterable<RemoteTest>> completer = new Completer<Iterable<RemoteTest>>();
Completer deathCompleter = new Completer(); Completer<String> deathCompleter = new Completer();
Process process = await _startProcess( Process process = await _startProcess(
listenerFile.path, listenerFile.path,
...@@ -139,7 +139,7 @@ void main() { ...@@ -139,7 +139,7 @@ void main() {
if (kExpectAllTestsToCloseCleanly && output != '') if (kExpectAllTestsToCloseCleanly && output != '')
print('Unexpected failure after test claimed to pass:\n$output'); print('Unexpected failure after test claimed to pass:\n$output');
} }
deathCompleter.complete(); deathCompleter.complete(output);
} catch (e) { } catch (e) {
// Throwing inside this block causes all kinds of hard-to-debug issues // Throwing inside this block causes all kinds of hard-to-debug issues
// like stack overflows and hangs. So catch everything just in case. // like stack overflows and hangs. So catch everything just in case.
......
...@@ -53,8 +53,9 @@ class RemoteTest extends Test { ...@@ -53,8 +53,9 @@ class RemoteTest extends Test {
} }
}); });
_socket.unusualTermination.then((_) { _socket.unusualTermination.then((String message) {
if (subscription != null) { if (subscription != null) {
controller.print('Unexpected subprocess termination: $message');
controller.addError(new Exception('Unexpected subprocess termination.'), new Trace.current()); controller.addError(new Exception('Unexpected subprocess termination.'), new Trace.current());
controller.setState(new State(Status.complete, Result.error)); controller.setState(new State(Status.complete, Result.error));
subscription.cancel(); subscription.cancel();
......
name: sky_tools name: sky_tools
version: 0.0.32 version: 0.0.33
description: Tools for building Flutter applications description: Tools for building Flutter applications
homepage: http://flutter.io homepage: http://flutter.io
author: Flutter Authors <flutter-dev@googlegroups.com> author: Flutter Authors <flutter-dev@googlegroups.com>
...@@ -8,6 +8,7 @@ environment: ...@@ -8,6 +8,7 @@ environment:
sdk: '>=1.12.0 <2.0.0' sdk: '>=1.12.0 <2.0.0'
dependencies: dependencies:
analyzer: ">=0.26.1+17" # see note below
archive: ^1.0.20 archive: ^1.0.20
args: ^0.13.0 args: ^0.13.0
flx: ">=0.0.1 <0.1.0" flx: ">=0.0.1 <0.1.0"
...@@ -21,6 +22,14 @@ dependencies: ...@@ -21,6 +22,14 @@ dependencies:
test: ^0.12.5 test: ^0.12.5
yaml: ^2.1.3 yaml: ^2.1.3
# A note about 'analyzer':
# We don't actually depend on 'analyzer', but 'test' does. We aren't
# compatible with some older versions of 'analyzer'. We lie here,
# saying we do depend on it, so that we constrain the version that
# 'test' will get to a version that we'll probably be ok with. (This
# is why there's no upper bound on our dependency.)
# See also https://github.com/dart-lang/pub/issues/1356
dev_dependencies: dev_dependencies:
mockito: "^0.10.1" mockito: "^0.10.1"
......
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