Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
vashworth committed Jan 6, 2023
commit 2dfdf979ccb4a4f5f499c93d87d9bc45590ee727
2 changes: 1 addition & 1 deletion packages/flutter_tools/lib/src/ios/devices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ class IOSDevice extends Device {
_logger.printTrace('Application launched on the device. Waiting for observatory url.');
final int defaultTimeout = interfaceType == IOSDeviceConnectionInterface.network ? 60 : 30;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found that this took longer when using a network device. 60 seconds might be a bit generous, though. Sometimes 30 seconds is enough, but sometimes it's more like 35. Not sure if people's internet connections might influence this (mine is pretty fast), which is why I overestimated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow that's a long time. Maybe 45 and we'll see if we get complaints?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Updated.

final Timer timer = Timer(discoveryTimeout ?? Duration(seconds: defaultTimeout), () {
_logger.printError('iOS Observatory not discovered after ${discoveryTimeout ?? defaultTimeout} seconds. This is taking much longer than expected...');
_logger.printError('iOS Observatory not discovered after $defaultTimeout seconds. This is taking much longer than expected...');
iosDeployDebugger?.pauseDumpBacktraceResume();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import 'package:flutter_tools/src/device.dart';
import 'package:flutter_tools/src/device_port_forwarder.dart';
import 'package:flutter_tools/src/ios/application_package.dart';
import 'package:flutter_tools/src/ios/devices.dart';
import 'package:flutter_tools/src/ios/iproxy.dart';
import 'package:flutter_tools/src/macos/macos_ipad_device.dart';
import 'package:flutter_tools/src/mdns_discovery.dart';
import 'package:flutter_tools/src/project.dart';
Expand Down Expand Up @@ -979,10 +980,15 @@ class FakeIOSDevice extends Fake implements IOSDevice {
DevicePortForwarder? portForwarder,
DeviceLogReader? logReader,
this.onGetLogReader,
this.interfaceType = IOSDeviceConnectionInterface.none,
// IOSDeviceConnectionInterface interfaceType = IOSDeviceConnectionInterface.none,
}) : _portForwarder = portForwarder, _logReader = logReader;

final DevicePortForwarder? _portForwarder;


final IOSDeviceConnectionInterface interfaceType;

@override
DevicePortForwarder get portForwarder => _portForwarder!;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ void main() {
stdout: devicesOutput,
));
final List<IOSDevice> devices = await xcdevice.getAvailableIOSDevices();
expect(devices, hasLength(3));
expect(devices, hasLength(4));
expect(devices[0].id, '00008027-00192736010F802E');
expect(devices[0].name, 'An iPhone (Space Gray)');
expect(await devices[0].sdkNameAndVersion, 'iOS 13.3 17C54');
Expand All @@ -488,10 +488,14 @@ void main() {
expect(devices[1].name, 'iPad 1');
expect(await devices[1].sdkNameAndVersion, 'iOS 10.1 14C54');
expect(devices[1].cpuArchitecture, DarwinArch.armv7);
expect(devices[2].id, 'f577a7903cc54959be2e34bc4f7f80b7009efcf4');
expect(devices[2].name, 'iPad 2');
expect(devices[2].id, '234234234234234234345445687594e089dede3c44');
expect(devices[2].name, 'A networked iPad');
expect(await devices[2].sdkNameAndVersion, 'iOS 10.1 14C54');
expect(devices[2].cpuArchitecture, DarwinArch.arm64); // Defaults to arm64 for unknown architecture.
expect(devices[3].id, 'f577a7903cc54959be2e34bc4f7f80b7009efcf4');
expect(devices[3].name, 'iPad 2');
expect(await devices[3].sdkNameAndVersion, 'iOS 10.1 14C54');
expect(devices[3].cpuArchitecture, DarwinArch.arm64); // Defaults to arm64 for unknown architecture.
expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{
Platform: () => macPlatform,
Expand Down