Skip to content

flutter drive CI tests fail targeting iOS 14, stuck on local network permission popup #65207

Description

@jmagman

On iOS 14, launching a debug/profile Flutter app will prompt the user to allow local network access when the observatory publishes:

Steps to Reproduce

$ cd dev/devicelab
$ dart bin/run.dart -t ios_platform_view_tests
...
[ios_platform_view_tests] [STDOUT] stdout: [   +3 ms] 00:00 +0: FlutterDriver Merge thread to create and remove platform views should not crash
[ios_platform_view_tests] [STDOUT] stderr: [+5053 ms] VMServiceFlutterDriver: waitFor message is taking a long time to complete...

and the test will time out.

If you hit OK in the dialog, the tests run and pass.

Activity

  1. added
    t: flutter driver"flutter driver", flutter_drive, or a driver test
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    toolAffects the "flutter" command-line tool. See also t: labels.
    P2Important issues not at the top of the work list
    on Sep 3, 2020
  2. jmagman commented on Sep 4, 2020

    @jmagman
    MemberAuthor

    I'm really not sure how to fix this in a driver CI setup where there's no person to tap the button on the device. The app itself doesn't have access to that popup (or that would defeat the purpose of forcing the user to allow the app to do things). Even the integration_test package is an XCTest, so it also doesn't have access to SpringBoard popups. That package would need to convert to XCUITests to pull a trick like:
    https://github.com/flutter/cocoon/blob/13876a4f9e4ba48be5fbbbec8940b9528482f77d/agent/tool/infra-dialog/infra-dialogUITests/infra_dialogUITests.swift#L12

    let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
  3. jmagman commented on Sep 4, 2020

    @jmagman
    Author
  4. xster commented on Sep 14, 2020

    @xster
    Member

    One guess/untested solution for xctest is we could potentially force the uri via --*-vmservice-port and --vmservice-port-file and some combination of (these things have been changing recently) to connect to. Some plumbing may be needed for the driver mechanism.

  5. jmagman commented on Sep 14, 2020

    @jmagman
    MemberAuthor

    I think that suggested port always gets passed in now. You're saying the engine should detect it's being driven and not publish the port? And we rely on other discovery mechanisms?

  6. xster commented on Sep 14, 2020

    @xster
    Member

    Somewhat, we don't need the bonjour mechanism if we know the observatory uri. There's no permissions needed to just open a listen port for the observatory. There's probably various plumbing needed but we could attempt to not add the plist entry for driven tests, have the tool write out the uri to a file (I didn't know we had the --vmservice-port-file flag but it seems like that's what it's for) and let the tool watch for that file when trying to connect during the drive than waiting for mdns.

  7. changed the title [-]flutter drive tests fail targeting iOS 14, stuck on local network permission popup[/-] [+]flutter drive CI tests fail targeting iOS 14, stuck on local network permission popup[/+] on Sep 15, 2020
  8. jmagman commented on Sep 15, 2020

    @jmagman
    MemberAuthor

    The tool already passes in a suggested port, and that's the first one that gets tried. #49735. But I guess the port-file is for getting attach working.

  9. xster commented on Sep 15, 2020

    @xster
    Member

    Ah cool, it even does --disable-service-auth-codes wish would be the next blocker I'd assume. I'm not sure it works since I always see an auth path in the observatory URI in the console. If it does, maybe we just need another flag to disable the new xcode_backend.sh function in flutter run. If the design of #49735 is sound, maybe there's just a bug?

    the --vmservice-out-file doesn't seem to make sense unfortunately. It seems like it's just writing it after finding the vmservice https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/run_hot.dart#L285.

  10. jmagman commented on Sep 16, 2020

    @jmagman
    MemberAuthor

    the --vmservice-out-file doesn't seem to make sense unfortunately. It seems like it's just writing it after finding the vmservice https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/run_hot.dart#L285.

    Not for flutter drive, but it makes sense if you flutter run then flutter attach or something like that.

  11. xster commented on Sep 16, 2020

    @xster
    Member

    Right. That one's not very useful for this case it seems.

  12. self-assigned this
    on Sep 17, 2020
  13. added
    P1High-priority issues at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on Sep 17, 2020
  14. xster commented on Sep 18, 2020

    @xster
    Member

    Does #66092 mean that we might decrease the need for the additional plist line and the dialog for the standard production use case if we can pull it out via the debugger and connect to the debug-uri/observatory uri directly?

  15. jmagman commented on Sep 18, 2020

    @jmagman
    MemberAuthor

    @xster Yes, at least for run/drive, that's the hope!

  16. xster commented on Sep 24, 2020

    @xster
    Member

    Does #66092 unblock us on this now?

  17. jmagman commented on Oct 15, 2020

    @jmagman
    MemberAuthor

    #67452 and flutter-team-archive/engine#21632 are merged. flutter drive no longer prompts the permission dialog.

  18. github-actions commented on Aug 11, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  19. locked as resolved and limited conversation to collaborators on Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: contributor-productivityTeam-specific productivity, code health, technical debt.t: flutter driver"flutter driver", flutter_drive, or a driver testtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions