Attempt to fix some web test flakiness. (#149828)
If the service is disposed when we make calls on it, we need to bubble up an exception that is understood by the callers. This is another speculative fix for https://github.com/flutter/flutter/issues/149238.
This commit is contained in:
parent
01d1e74af5
commit
5fb34b719e
@ -989,6 +989,9 @@ class FlutterVmService {
|
||||
}
|
||||
}
|
||||
return await extensionAdded.future;
|
||||
} on vm_service.RPCError {
|
||||
// Translate this exception into something the outer layer understands
|
||||
throw VmServiceDisappearedException();
|
||||
} finally {
|
||||
await isolateEvents.cancel();
|
||||
try {
|
||||
|
@ -789,6 +789,17 @@ void main() {
|
||||
throwsA(isA<VmServiceDisappearedException>()),
|
||||
);
|
||||
});
|
||||
|
||||
testWithoutContext('throws when the service is disposed', () async {
|
||||
final FakeVmServiceHost fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
|
||||
|
||||
await fakeVmServiceHost.vmService.dispose();
|
||||
|
||||
expect(
|
||||
() => fakeVmServiceHost.vmService.findExtensionIsolate(kExtensionName),
|
||||
throwsA(isA<VmServiceDisappearedException>()),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
testWithoutContext('Can process log events from the vm service', () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user