Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase xcdevice timeout to 2 seconds #53184

Merged
merged 3 commits into from Mar 25, 2020
Merged

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Mar 24, 2020

Description

xcdevice was returning before it found all tethered devices on some machines, flakily. Up the timeout to 2 seconds. :-(

Related Issues

Fixes #53182

Tests

Updated xcode_tests with new behavior.

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Mar 24, 2020
@jmagman jmagman self-assigned this Mar 24, 2020
@christopherfujino
Copy link
Member

I remember there was discussion around this, but what is the default again? @jmagman

@jmagman
Copy link
Member Author

jmagman commented Mar 24, 2020

I remember there was discussion around this, but what is the default again? @jmagman

I don't think the default is documented, but without a timeout it returns as soon as it discovers all the tethered devices and simulators, I believe. So on my machine it's <0.5 seconds. For some reason on some machines it takes longer than a second (at least I'm guessing that's what's happening) so this PR is to let xcdevice take the time it needs. This is kind of speculation though since the help text doesn't say.

xcdevice list [--timeout=sec]
	Lists all available devices and simulators. A higher timeout value may be required to detect network devices and paired Apple Watches.

@christopherfujino
Copy link
Member

I'm getting ~6 seconds running time xcrun xcdevices list locally with nothing plugged in.

@christopherfujino
Copy link
Member

Analysis is failing with:

warning • The parameter 'timeout' is required • packages/flutter_tools/lib/src/macos/xcode.dart:512:53 • missing_required_param

@jmagman
Copy link
Member Author

jmagman commented Mar 24, 2020

I'm getting ~6 seconds running time xcrun xcdevices list locally with nothing plugged in.

Hmm, maybe I need to up it to 2 seconds then. I've seen missing plugged in devices quite a few times in the devicelab today.

Copy link
Member

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@jmagman
Copy link
Member Author

jmagman commented Mar 24, 2020

This makes me sad.

@jmagman jmagman changed the title Remove 1 second timeout, let xcdevice use its default Increase xcdevice timeout to 2 seconds Mar 24, 2020
@jmagman jmagman merged commit b860a39 into flutter:master Mar 25, 2020
@jmagman jmagman deleted the xcdevice-timeout branch March 25, 2020 18:14
@jmagman jmagman added the platform-ios iOS applications specifically label Aug 21, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USB tethered iOS devices sometimes not found
3 participants