[flutter_tools] make failures to unforward android port non-fatal (#82477)
This commit is contained in:
@@ -143,7 +143,7 @@ void main() {
|
||||
await forwarder.unforward(ForwardedPort(456, 23));
|
||||
});
|
||||
|
||||
testWithoutContext('failures to unforward port throw exception if stderr is not recognized', () async {
|
||||
testWithoutContext('failures to unforward port print error but are non-fatral', () async {
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>['adb', '-s', '1', 'forward', '--remove', 'tcp:456'],
|
||||
@@ -151,13 +151,16 @@ void main() {
|
||||
exitCode: 1,
|
||||
)
|
||||
]);
|
||||
final BufferLogger logger = BufferLogger.test();
|
||||
final AndroidDevicePortForwarder forwarder = AndroidDevicePortForwarder(
|
||||
adbPath: 'adb',
|
||||
deviceId: '1',
|
||||
processManager: processManager,
|
||||
logger: BufferLogger.test(),
|
||||
logger: logger,
|
||||
);
|
||||
|
||||
expect(() => forwarder.unforward(ForwardedPort(456, 23)), throwsProcessException());
|
||||
await forwarder.unforward(ForwardedPort(456, 23));
|
||||
|
||||
expect(logger.errorText, contains('Failed to unforward port: error: everything is broken!'));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user