Skip to content

Sync changes from internal dev branch.#89

Merged
kaishi05 merged 1 commit into
mainfrom
copybara_HEAD
Apr 9, 2026
Merged

Sync changes from internal dev branch.#89
kaishi05 merged 1 commit into
mainfrom
copybara_HEAD

Conversation

@lip-liu

@lip-liu lip-liu commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

PiperOrigin-RevId: 896685330
@lip-liu lip-liu requested a review from kaishi05 April 8, 2026 21:19

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the existing SCC 2G Wi-Fi Direct (WFD) STA test with a new XCC 2G WFD STA test, updating the test suite and incrementing the suite version. The new xcc_2g_wfd_sta_test.py file introduces a test designed to cover both SCC and MCC scenarios for WFD medium with 2G channel and JP country code. The review highlights a critical issue where mcc_file_size_kb and scc_file_size_kb constants are swapped in transfer_file_for_unknown_concurrency_mode, which could lead to incorrect test parameters. Additionally, there are suggestions to correct the docstring for test_xcc_2g_wfd_sta to accurately reflect "Wifi XCC", address a logical inconsistency where WifiConcurrencyMode.UNKNOWN is listed as a valid mode despite being an unexpected state, and fix a typo in an error message.

Comment on lines +262 to +265
mcc_file_size_kb=nc_constants.NC_SCC_2G_TRANSFER_FILE_SIZE_KB,
mcc_timeout=constants.WIFI_2G_20M_PAYLOAD_TRANSFER_TIMEOUT,
scc_file_size_kb=nc_constants.NC_MCC_5G_D2D_2G_STA_TRANSFER_FILE_SIZE_KB,
scc_timeout=constants.WIFI_100M_PAYLOAD_TRANSFER_TIMEOUT,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The arguments passed to transfer_file_for_unknown_concurrency_mode appear to be swapped. mcc_file_size_kb is receiving an SCC constant, while scc_file_size_kb is receiving an MCC constant. This will lead to incorrect test parameters being used if the concurrency mode is unknown.

Suggested change
mcc_file_size_kb=nc_constants.NC_SCC_2G_TRANSFER_FILE_SIZE_KB,
mcc_timeout=constants.WIFI_2G_20M_PAYLOAD_TRANSFER_TIMEOUT,
scc_file_size_kb=nc_constants.NC_MCC_5G_D2D_2G_STA_TRANSFER_FILE_SIZE_KB,
scc_timeout=constants.WIFI_100M_PAYLOAD_TRANSFER_TIMEOUT,
mcc_file_size_kb=nc_constants.NC_MCC_5G_D2D_2G_STA_TRANSFER_FILE_SIZE_KB,
mcc_timeout=constants.WIFI_100M_PAYLOAD_TRANSFER_TIMEOUT,
scc_file_size_kb=nc_constants.NC_SCC_2G_TRANSFER_FILE_SIZE_KB,
scc_timeout=constants.WIFI_2G_20M_PAYLOAD_TRANSFER_TIMEOUT,

max_consecutive_error=_MAX_CONSECUTIVE_ERROR,
)
def test_xcc_2g_wfd_sta(self):
"""Test the performance for Wifi SCC with 2G WFD and STA."""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The docstring for test_xcc_2g_wfd_sta mentions "Wifi SCC", but this test class is designed for "Wifi XCC" and covers both SCC and MCC scenarios as per the class docstring. The method docstring should be updated for accuracy.

Suggested change
"""Test the performance for Wifi SCC with 2G WFD and STA."""
"""Test the performance for Wifi XCC with 2G WFD and STA."""

Comment on lines +215 to +219
valid_concurrency_modes=[
constants.WifiConcurrencyMode.SCC_2G,
constants.WifiConcurrencyMode.MCC_5G_P2P_2G_STA,
constants.WifiConcurrencyMode.UNKNOWN,
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

WifiConcurrencyMode.UNKNOWN is included in the valid_concurrency_modes list, but later in the code (line 255), it is stated that this mode "should not happen". If UNKNOWN is considered a failure state or an unexpected condition, it should be removed from the valid modes list to allow the assertion to catch it.

        valid_concurrency_modes=[
            constants.WifiConcurrencyMode.SCC_2G,
            constants.WifiConcurrencyMode.MCC_5G_P2P_2G_STA,
        ],

],
test_result=self.current_test_result,
additional_error_message=(
'If the device can detected as indoor, the concurrency mode should'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Typo in error message: "can detected" should be "is detected" or "can be detected".

Suggested change
'If the device can detected as indoor, the concurrency mode should'
'If the device is detected as indoor, the concurrency mode should'

@kaishi05 kaishi05 merged commit 18397ac into main Apr 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants