Commit Graph

46 Commits

Author SHA1 Message Date
Christopher Fujino
fac41dde7f
[flutter_tools] catch SocketException writing to ios-deploy stdin (#139784)
Fixes https://github.com/flutter/flutter/issues/139709

This adds a static helper method `ProcessUtils.writelnToStdinGuarded()`, which will asynchronously write to a sub-process's STDIN `IOSink` and catch errors.

In talking with Brian, it sounds like this is the best and most reliable way to catch `SocketException`s during these writes *to sub-process file descriptors* specifically (with a "real" hard drive file, the future returned by `.flush()` should complete with the write error).

Also, as I note in the dartdoc to `writelnToStdinGuarded()`, the behavior seems to be different between macOS and linux.

Moving forward, in any place where we want to catch exceptions writing to STDIN, we will want to use this new helper.
2023-12-12 00:32:18 +00:00
Michael Goderbauer
b0a90aee17
Enable strict-inference (#135043)
Avoids that dynamic accidentally sneaks in, see https://dart.dev/tools/analysis#enabling-additional-type-checks
2023-09-20 19:59:08 +00:00
Victoria Ashworth
6683468f0b
Add debugging for iOS startup test flakes (#130099)
Adding debugging for https://github.com/flutter/flutter/issues/129836.

Takes a screenshot when startup test takes too long (10 minutes).

Also, removes some old debugging and add new debugging message.
2023-07-07 16:49:00 +00:00
Victoria Ashworth
8e6a9e3a9e
Revert "Log all lines from ios-deploy (#127502)" (#127684)
This reverts commit a19b3436ee.

We added this logging to try and determine if the reason for Dart VM errors (https://github.com/flutter/flutter/issues/121231) was caused by some issue with the streams.
A recent test proves that is not the case:
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20platform_view_ios__start_up/11046/overview
The test shows the Dart VM url in the device log. However, the test log does NOT show a log for the Dart VM url but does show the stack trace, which all come from the main stream, which means it's not an issue with the secondary streams not receiving the log.

So reverting the debugging we added.
2023-05-26 20:11:54 +00:00
Victoria Ashworth
a19b3436ee
Log all lines from ios-deploy (#127502)
Reland https://github.com/flutter/flutter/pull/127222 that was reverted in https://github.com/flutter/flutter/pull/127405.

Fixed `Mac_ios microbenchmarks_ios` test failure by not echoing logs twice.
2023-05-24 19:46:16 +00:00
Victoria Ashworth
d452ce9635
Revert "Log all output of ios-deploy" (#127405)
Reverts flutter/flutter#127222
2023-05-23 16:37:36 +00:00
Victoria Ashworth
7fa45ea486
Log all output of ios-deploy (#127222)
Log all output of `ios-deploy` to try and determine if the issue of https://github.com/flutter/flutter/issues/121231 is with stream or with `ios-deploy`.

Note: This will cause some duplicate logs like example below but only in verbose mode

```
(lldb) 2023-05-19 13:48:19.107935-0500 Runner[2521:390363] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(35)] Using the Impeller rendering backend.
(lldb) 2023-05-19 13:48:19.107935-0500 Runner[2521:390363] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(35)] Using the Impeller rendering backend.
2023-05-19 13:48:19.156866-0500 Runner[2521:390612] flutter: The Dart VM service is listening on http://127.0.0.1:63508/IsFnhXJykCM=/
VM Service URL on device: http://127.0.0.1:63508/IsFnhXJykCM=/
```
2023-05-23 15:25:10 +00:00
Victoria Ashworth
b9e8b0a827
[iOS] Dispose of log readers and port forwarders if launch fails (#127140)
When tests run in our CI using `flutter drive`, if there is a failure it will loop and try again.

434b81f1a5/packages/flutter_tools/lib/src/drive/drive_service.dart (L177-L186)

However, it's using the same `device` instance for each iteration. So what was happening was when it would fail to launch, it would tell its listeners that it was cancelled.
434b81f1a5/packages/flutter_tools/lib/src/ios/ios_deploy.dart (L486-L489) 

Then when the next iteration started, the `vmServiceDiscovery` would immediately return with null because the `deviceLogReader` would be cached from the previous iteration and would already be cancelled. Therefore, bypassing and cancelling the timer.

434b81f1a5/packages/flutter_tools/lib/src/ios/devices.dart (L585-L591)

434b81f1a5/packages/flutter_tools/lib/src/ios/devices.dart (L627)

In addition, it seems like sometimes the stop would fail and therefore the the drain would never get the signal that it was done and therefore would hang forever. There was no indication that the stop had failed though because the logs were going to the stream that had no listeners since `deviceLogReader` was already cancelled.
434b81f1a5/packages/flutter_tools/lib/src/ios/ios_deploy.dart (L563-L576)

Fixes https://github.com/flutter/flutter/issues/127141
2023-05-19 16:44:58 +00:00
Victoria Ashworth
5d1132561f
Add debugging for Dart VM timeout flake (#126437)
Check what is available in the device's iOS DeviceSupport folder to check if symbols were properly fetched. Also, add some logging to track what status the debugger is in.

Debugging for https://github.com/flutter/flutter/issues/121231.
2023-05-15 17:51:05 +00:00
Victoria Ashworth
27248d4b64
Separate attached and wireless devices (#122615)
Separate attached and wireless devices
2023-03-15 16:35:05 +00:00
林洵锋
ec524ed068
Fix flutter_tools stuck when using custom LLDB prompt (#119443)
* Fix flutter_tools stuck when using custom LLDB prompt

* Remove trailing space character

* Fix local variable name

* Add comment

* Remove trailing space character

* Update packages/flutter_tools/lib/src/ios/ios_deploy.dart

Co-authored-by: Jenn Magder <magder@google.com>

* Update packages/flutter_tools/lib/src/ios/ios_deploy.dart

Co-authored-by: Jenn Magder <magder@google.com>

* Remove trailing space character

---------

Co-authored-by: Jenn Magder <magder@google.com>
2023-02-06 22:50:07 +00:00
Jenn Magder
4dc1bd40d4
Handle updated error message when iOS device is locked (#108057) 2022-07-26 22:33:07 +00:00
Christopher Fujino
09686a04c9
[flutter_tools] add --uninstall-first flag and pipe it through to ios-deploy (#102948) 2022-05-07 11:49:07 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
Christopher Fujino
d07ce92b15
[flutter_tools] Re-land Dump backtrace on ios app startup timeout (#101763) 2022-04-12 13:24:04 -07:00
Christopher Fujino
2a6582997d
Revert "[flutter_tools] Dump backtrace on ios app startup timeout (#101610)" (#101761)
This reverts commit 2978b59be7.
2022-04-12 09:09:32 -07:00
Christopher Fujino
2978b59be7
[flutter_tools] Dump backtrace on ios app startup timeout (#101610) 2022-04-12 08:49:08 -07:00
Jenn Magder
9369bd3222
Wait for ios-deploy stdout before closing logLine stream (#99041) 2022-02-24 19:21:23 -08:00
Jenn Magder
cef6823637
Dump backtrace when cannot attach to observatory (#98550) 2022-02-16 14:10:18 -08:00
Jenn Magder
855af29084
Migrate ios_deploy to null safety (#88851) 2021-09-09 17:32:05 -07:00
Jenn Magder
57efbd5310
Rename IOSDeviceInterface to IOSDeviceConnectionInterface (#88144) 2021-08-16 10:27:03 -07:00
Jonah Williams
b30d97a64c
[flutter_tools] split host artifacts out of Artifacts (#80876) 2021-04-22 19:29:02 -07:00
Jonah Williams
0a59698ebe
[flutter_tools] migrate cache to null safety (#79864) 2021-04-06 14:44:02 -07:00
Sam Rawlins
68492c5b69
Remove "unnecessary" imports. (#78664) 2021-04-06 11:19:02 -07:00
Jenn Magder
d018c24bb8
MockProcessUtils->FakeProcessManager in version_test (#77985) 2021-03-12 16:38:04 -08:00
Jenn Magder
08b225e03d
Implement iOS app install deltas (#77756) 2021-03-10 10:00:03 -08:00
Sam Rawlins
ba58ad0385
Remove "unnecessary" imports in test/general.shard (#75954) 2021-02-18 13:38:24 -08:00
Jonah Williams
021311ed8a
Revert "[flutter_tools] move process manager into tool (#75350)" (#75639)
This reverts commit 8b6baae44c.
2021-02-08 09:21:46 -08:00
Jonah Williams
8b6baae44c
[flutter_tools] move process manager into tool (#75350)
Our current top crasher is an unclear error when ProcessManager fails to resolve an executable path. To fix this, we'd like to being adjusting the process resolution logic and adding more instrumentation to track failures. In order to begin the process, the ProcessManager has been folded back into the flutter tool
2021-02-04 13:19:11 -08:00
Jonah Williams
74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
Jenn Magder
832d776b15
Stop debugger when iOS app crashes (#68844) 2020-10-23 14:12:04 -07:00
Jenn Magder
acde65d14a
Revert noninteractive lldb debugging, timeout warning (#68245) 2020-10-15 18:02:15 -07:00
Jenn Magder
1fb94fb894
Noninteractive iOS debugger session (#68145) 2020-10-14 15:38:07 -07:00
Jenn Magder
3e0d2741de
Detach debugger when VM connection fails on iOS (#68046) 2020-10-13 12:50:50 -07:00
Jenn Magder
becaf4913f
Replace MockCache with Cache.test() (#66946) 2020-09-30 14:53:57 -07:00
Jenn Magder
d5b715d7cb
Stream logging from attached debugger on iOS 13+ (#66399) 2020-09-22 17:16:45 -07:00
Jenn Magder
4881b4b07c
Revert "Stream logging from attached debugger on iOS (#66092) (#66390)" (#66397)
This reverts commit 2be4570d3a.
2020-09-22 15:15:56 -07:00
Jenn Magder
2be4570d3a
Stream logging from attached debugger on iOS (#66092) (#66390) 2020-09-22 14:59:14 -07:00
Jenn Magder
8d2e257633
Revert "Stream logging from attached debugger on iOS (#66092)" (#66368)
This reverts commit 5c8580360a.
2020-09-22 11:30:50 -07:00
Dan Field
4299dd7843
Revert "Revert "Stream logging from attached debugger on iOS (#66092)" (#66359)" (#66360)
This reverts commit 53fee1be38.
2020-09-22 09:23:57 -07:00
Dan Field
53fee1be38
Revert "Stream logging from attached debugger on iOS (#66092)" (#66359)
This reverts commit 5c8580360a.
2020-09-22 09:22:55 -07:00
Jenn Magder
5c8580360a
Stream logging from attached debugger on iOS (#66092) 2020-09-18 15:26:28 -07:00
Zachary Anderson
6f0ed5e142
[flutter_tools] Restore base/platform.dart (#56410) 2020-05-06 08:15:39 -07:00
Jonah Williams
c5800fe107
[flutter_tools] update iOS deploy tests for best practices (#53343) 2020-03-26 17:31:01 -07:00
Jonah Williams
3489da9328
[flutter_tools] no more MockLogger in tests (#51684) 2020-03-02 16:23:56 -08:00
Christopher Fujino
704fb4cbc7
Remove usage of ideviceinstaller in favor of ios-deploy (#50772) 2020-02-25 09:09:40 -08:00