-
Notifications
You must be signed in to change notification settings - Fork 146
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
Fix test bundling on physical iOS devices #1303
Conversation
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
This reverts commit c7a3f09.
@@ -140,12 +136,6 @@ class IOSTestBackend { | |||
final subject = '${options.description} on ${device.description}'; | |||
final task = _logger.task('Running $subject'); | |||
|
|||
Process? iosDeployProcess; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note:
Calling XCUIApplication.launch()
with the debugger attached causes really nasty crashes.
TODO: Print error message when trying to For example:
|
bf896a4
to
ca57328
Compare
Actually, we're already doing this. But still, the Flutter bug breaks Hot Restart on physical iOS devices. |
Are these limitations documented anywhere (do you have any changelog?)?
What is the predicted impact of this limitation? Is there any benefit of debug mode testing?
Because of some connection issue? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Do we plan using go-ios?
|
Yes, we do, although it's pretty basic (https://pub.dev/packages/patrol/changelog). We'll be rewriting the docs for 2.0 + writing a migration guide.
We're aware of this.
I don't know, but I suspect it's because Patrol (running in the app under test) makes HTTP requests to the Patrol server (running in the instrumentation app). More specifically, all communication between these 2 apps happen over gRPC (which builds on HTTP/2’s long-lived connections). And toggling (yes, toggling - everything works when airplane mode is enabled, and disabling it results in tests crashing) airplane mode probably somehow interferes with this. |
This PR fixes #1297.
Caveats
Running tests on iOS works only in release mode (
patrol test --release
).Hot Restart doesn't work.
That's because, in a Flutter app built in release mode, there's no Dart VM that can JIT compile code.
In other words, for Hot Restart to work, the app must be started in debug mode on iOS.
Starting the app in debug mode on iOS is mutually exclusive with test bundling.
A workaround would be to not use test bundling at all when using Hot Restart.
This would require re-adding the code that was present before test bundling.
But even if we fixed this and re-added that, Hot Restart on iOS wouldn't work right away. We'd also have to fix Hot restart on physical iOS is not working #1059.
Enabling or disabling airplane mode crashes the test suite.
cc: @mateuszwojtczak, @jBorkowska