mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Increase xcdevice timeout to 2 seconds (#53184)
This commit is contained in:
parent
207efd4cee
commit
b860a3912b
|
@ -275,9 +275,9 @@ class XCDevice {
|
|||
|
||||
List<dynamic> _cachedListResults;
|
||||
|
||||
/// [timeout] defaults to 1 second.
|
||||
/// [timeout] defaults to 2 seconds.
|
||||
Future<List<IOSDevice>> getAvailableTetheredIOSDevices({ Duration timeout }) async {
|
||||
final List<dynamic> allAvailableDevices = await _getAllDevices(timeout: timeout ?? const Duration(seconds: 1));
|
||||
final List<dynamic> allAvailableDevices = await _getAllDevices(timeout: timeout ?? const Duration(seconds: 2));
|
||||
|
||||
if (allAvailableDevices == null) {
|
||||
return const <IOSDevice>[];
|
||||
|
@ -515,7 +515,7 @@ class XCDevice {
|
|||
Future<List<String>> getDiagnostics() async {
|
||||
final List<dynamic> allAvailableDevices = await _getAllDevices(
|
||||
useCache: true,
|
||||
timeout: const Duration(seconds: 1)
|
||||
timeout: const Duration(seconds: 2)
|
||||
);
|
||||
|
||||
if (allAvailableDevices == null) {
|
||||
|
|
|
@ -262,8 +262,8 @@ void main() {
|
|||
when(processManager.runSync(<String>['xcrun', '--find', 'xcdevice']))
|
||||
.thenReturn(ProcessResult(1, 0, '/path/to/xcdevice', ''));
|
||||
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '1']))
|
||||
.thenThrow(const ProcessException('xcrun', <String>['xcdevice', 'list', '--timeout', '1']));
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
|
||||
.thenThrow(const ProcessException('xcrun', <String>['xcdevice', 'list', '--timeout', '2']));
|
||||
|
||||
expect(await xcdevice.getAvailableTetheredIOSDevices(), isEmpty);
|
||||
});
|
||||
|
@ -367,7 +367,7 @@ void main() {
|
|||
]
|
||||
''';
|
||||
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '1']))
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
|
||||
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, devicesOutput, '')));
|
||||
final List<IOSDevice> devices = await xcdevice.getAvailableTetheredIOSDevices();
|
||||
expect(devices, hasLength(3));
|
||||
|
@ -429,7 +429,7 @@ void main() {
|
|||
]
|
||||
''';
|
||||
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '1']))
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
|
||||
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, devicesOutput, '')));
|
||||
final List<IOSDevice> devices = await xcdevice.getAvailableTetheredIOSDevices();
|
||||
expect(devices, hasLength(1));
|
||||
|
@ -456,8 +456,8 @@ void main() {
|
|||
when(processManager.runSync(<String>['xcrun', '--find', 'xcdevice']))
|
||||
.thenReturn(ProcessResult(1, 0, '/path/to/xcdevice', ''));
|
||||
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '1']))
|
||||
.thenThrow(const ProcessException('xcrun', <String>['xcdevice', 'list', '--timeout', '1']));
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
|
||||
.thenThrow(const ProcessException('xcrun', <String>['xcdevice', 'list', '--timeout', '2']));
|
||||
|
||||
expect(await xcdevice.getDiagnostics(), isEmpty);
|
||||
});
|
||||
|
@ -489,7 +489,7 @@ void main() {
|
|||
]
|
||||
''';
|
||||
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '1']))
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
|
||||
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, devicesOutput, '')));
|
||||
await xcdevice.getAvailableTetheredIOSDevices();
|
||||
final List<String> errors = await xcdevice.getDiagnostics();
|
||||
|
@ -591,7 +591,7 @@ void main() {
|
|||
]
|
||||
''';
|
||||
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '1']))
|
||||
when(processManager.run(<String>['xcrun', 'xcdevice', 'list', '--timeout', '2']))
|
||||
.thenAnswer((_) => Future<ProcessResult>.value(ProcessResult(1, 0, devicesOutput, '')));
|
||||
final List<String> errors = await xcdevice.getDiagnostics();
|
||||
expect(errors, hasLength(4));
|
||||
|
|
Loading…
Reference in a new issue