Unverified Commit db9a035e authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Wait for isolate start before proceeding with expression evaluation tests (#42464)

Fixes https://github.com/flutter/flutter/issues/42359
parent 0aafdfa5
......@@ -127,8 +127,12 @@ abstract class FlutterTestDriver {
_vmService = await vmServiceConnectUri('$_vmServiceWsUri');
_vmService.onSend.listen((String s) => _debugPrint(s, topic: '=vm=>'));
_vmService.onReceive.listen((String s) => _debugPrint(s, topic: '<=vm='));
final Completer<void> isolateStarted = Completer<void>();
_vmService.onIsolateEvent.listen((Event event) {
if (event.kind == EventKind.kIsolateExit && event.isolate.id == _flutterIsolateId) {
if (event.kind == EventKind.kIsolateStart) {
isolateStarted.complete();
} else if (event.kind == EventKind.kIsolateExit && event.isolate.id == _flutterIsolateId) {
// Hot restarts cause all the isolates to exit, so we need to refresh
// our idea of what the Flutter isolate ID is.
_flutterIsolateId = null;
......@@ -140,6 +144,10 @@ abstract class FlutterTestDriver {
_vmService.streamListen('Debug'),
]);
if ((await _vmService.getVM()).isolates.isEmpty) {
await isolateStarted.future;
}
await waitForPause();
if (pauseOnExceptions) {
await _vmService.setExceptionPauseMode(
......
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