Do exponential backoff for all exceptions in VMService::defaultOpenChannel. (#16785)
We were trying to only catch WebSocketException, but in fact SocketException can be thrown as well.
This commit is contained in:
@@ -4,17 +4,19 @@
|
||||
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
import 'package:flutter_tools/src/base/port_scanner.dart';
|
||||
import 'package:flutter_tools/src/vmservice.dart';
|
||||
|
||||
import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
|
||||
void main() {
|
||||
group('VMService', () {
|
||||
test('fails connection eagerly in the connect() method', () async {
|
||||
testUsingContext('fails connection eagerly in the connect() method', () async {
|
||||
final int port = await const HostPortScanner().findAvailablePort();
|
||||
expect(
|
||||
VMService.connect(Uri.parse('http://localhost:$port')),
|
||||
throwsA(const isInstanceOf<SocketException>()),
|
||||
throwsToolExit(),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user