Terminate simulator app on "q"#114114
Conversation
| @override | ||
| Future<bool> stopApp( | ||
| ApplicationPackage app, { | ||
| ApplicationPackage? app, { |
| }) async { | ||
| // Currently we don't have a way to stop an app running on iOS. | ||
| return false; | ||
| if (app == null) { |
There was a problem hiding this comment.
when app is null, does it mean it's running on simulator? (maybe add a comment?)
There was a problem hiding this comment.
I believe the only situation the app could be null is if we're in a web context where we allow running an app even if you don't have a platform directory
There was a problem hiding this comment.
or you wrote a tap test that passes null...
There was a problem hiding this comment.
when
appis null, does it mean it's running on simulator? (maybe add a comment?)
This is the stopApp on IOSSimulator, it would only be called if the device is a simulator.
or you wrote a tap test that passes null...
It's essentially this 🙂
There's some subtle null safety issues going on here #114090, and I tried to resolve some of it in #114112
The base class Device can take a null app package because it's not needed for web devices.
flutter/packages/flutter_tools/lib/src/device.dart
Lines 585 to 588 in 80d4e5a
That means the subclasses need to be able to handle a null app bundle being passed in, even if it's pretty meaningless to that device (everything but web). When this PR first landed, it caused a TAP test failure that blocked the g3 roll
https://fusion2.corp.google.com/invocations/68e930bd-fdd0-486f-9b8d-dec7798677c9/targets/%2F%2Fmobile%2Fflutter%2Ftests%2Fapp:app_basic_runner_attach_ios_test_IPHONE_11_13_0/log
[ +1 ms] An Observatory debugger and profiler on iOS Simulator 1666796923577 is available at: http://127.0.0.1:55892/
stderr: [ +7 ms] NoSuchMethodError: The getter 'id' was called on null.
stderr: Receiver: null
stderr: Tried calling: id
stderr: #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)
stderr: #1 IOSSimulator.stopApp (package:flutter_tools/src/ios/simulators.dart:558:47)
stderr: #2 FlutterDevice.exitApps (package:flutter_tools/src/resident_runner.dart:358:19)
stderr: #3 ResidentRunner.exitApp (package:flutter_tools/src/resident_runner.dart:1431:67)
stderr: #4 ResidentRunner.exit (package:flutter_tools/src/resident_runner.dart:1276:11)
stderr: <asynchronous suspension>
stderr: #5 TerminalHandler._commonTerminalInputHandler (package:[flutter_tools/src/resident_runner.dart:1701](https://cs.corp.google.com/piper///depot/google3/flutter_tools/src/resident_runner.dart?l=1701&ws=tap-presubmit-rerun-server/2126220&snapshot=2):9)
stderr: <asynchronous suspension>
stderr: #6 TerminalHandler.processTerminalInput (package:[flutter_tools/src/resident_runner.dart:1760](https://cs.corp.google.com/piper///depot/google3/flutter_tools/src/resident_runner.dart?l=1760&ws=tap-presubmit-rerun-server/2126220&snapshot=2):7)
stderr: <asynchronous suspension>
There was a problem hiding this comment.
may i ask what's TAP?
There was a problem hiding this comment.
Actually, can you add a TODO comment here that we should probably be throwing an UnimplementedError here and the TAP test updated?
There was a problem hiding this comment.
may i ask what's TAP?
Google's internal test runner. So this passed LUCI tests, and then broke internal tests the first time.
There was a problem hiding this comment.
am i correct to say LUCI is running on our github CI for public flutter, and TAP is running on google's internal CI for internal flutter deployment?
| expect(fakeProcessManager, hasNoRemainingExpectations); | ||
| }); | ||
|
|
||
| testWithoutContext('simulator stopApp handles null app package', () async { |
This reverts commit 15e6944.
#113581 caused a TAP failure as a null
ApplicationPackagewas being passed intostopApp. It was partially reverted with #114083.Re-land, handling the null case, plus a test.
Fixes #113580
Fixes #52232
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.