Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0f8a6ab4
Unverified
Commit
0f8a6ab4
authored
May 14, 2021
by
Jonah Williams
Committed by
GitHub
May 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] make failures to unforward android port non-fatal (#82477)
parent
8334fb0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+2
-5
android_device_port_forwarder_test.dart
...ral.shard/android/android_device_port_forwarder_test.dart
+6
-3
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
0f8a6ab4
...
...
@@ -1313,13 +1313,10 @@ class AndroidDevicePortForwarder extends DevicePortForwarder {
],
throwOnError:
false
,
);
// The port may have already been unforwarded, for example if there
// are multiple attach process already connected.
if
(
runResult
.
exitCode
==
0
||
runResult
.
stderr
.
contains
(
"listener '
$tcpLine
' not found"
))
{
if
(
runResult
.
exitCode
==
0
)
{
return
;
}
runResult
.
throwException
(
'Process exited abnormally:
\n
$runResult
'
);
_logger
.
printError
(
'Failed to unforward port:
$runResult
'
);
}
@override
...
...
packages/flutter_tools/test/general.shard/android/android_device_port_forwarder_test.dart
View file @
0f8a6ab4
...
...
@@ -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!'
));
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment