Skip to content
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

Check whether adb forwarding takes effect when hit socket connection failure #957

Merged
merged 7 commits into from
Mar 21, 2025

Conversation

mhaoli
Copy link
Collaborator

@mhaoli mhaoli commented Mar 17, 2025

Check whether adb forwarding takes effect when hit socket connection failure.

Tested E2E locally.


This change is Reviewable

@mhaoli mhaoli added this to the Mobly Release 1.13 milestone Mar 17, 2025
@mhaoli mhaoli self-assigned this Mar 17, 2025
Copy link
Collaborator

@xianyuanjia xianyuanjia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @xpconanfan)


mobly/controllers/android_device_lib/snippet_client_v2.py line 457 at r1 (raw file):

            f'netstat tulpn | grep ":{self.host_port}"', shell=True
        )
        if not stdout:

What happens when there is a stdout? Seems like it would just fail silently and run into attribute error in the next line.


mobly/controllers/android_device_lib/snippet_client_v2.py line 460 at r1 (raw file):

          raise errors.Error(
              self._device,
              'The Adb forward command execution does not take effect. Please'

did

Code quote:

does

Copy link
Collaborator Author

@mhaoli mhaoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @xianyuanjia and @xpconanfan)


mobly/controllers/android_device_lib/snippet_client_v2.py line 457 at r1 (raw file):

Previously, xianyuanjia wrote…

What happens when there is a stdout? Seems like it would just fail silently and run into attribute error in the next line.

Opps, good catch. Added the logic to raise an exception with default error message and unit test for it.


mobly/controllers/android_device_lib/snippet_client_v2.py line 460 at r1 (raw file):

Previously, xianyuanjia wrote…

did

Done.

Copy link
Collaborator

@xianyuanjia xianyuanjia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @mhaoli and @xpconanfan)

@mhaoli mhaoli merged commit 991ecb2 into master Mar 21, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants