mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Wait for isolate start before proceeding with expression evaluation tests (#42464)
Fixes https://github.com/flutter/flutter/issues/42359
This commit is contained in:
parent
0aafdfa55a
commit
db9a035e7c
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user