[action] [PR:25947] [C0] Update timeout fomula for test_console_loopback#1289
Merged
Merged
Conversation
<!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md --> ### Description of PR Summary: Re-evaluate the timeout formula in `test_console_loopback` so it reflects the actual round-trip cost. The old formula `(packet_size * 10) * delay_factor / baud_rate` models only the on-wire transmission time and scales inversely with baud rate. The real round-trip also includes baud-independent overhead: SSH round-trip through the mgmt LAN, sshd + pty + picocom bridge on the DUT, and pexpect's poll granularity. Splitting the timeout into a fixed term plus a wire-time term is a more accurate model, and lets us drop the platform-specific fudge factors that were compensating for the missing term. ### Type of change - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [x] Test case improvement ### Back port request - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 Tracking issue/work item for backport/cherry-pick request: Failure type: ### Approach #### What is the motivation for this PR? The existing formula only accounts for on-wire time, so the timeout shrinks with baud rate even though the fixed SSH/pty/pexpect overhead does not. This forced per-platform multipliers to keep the timeout usable, and still left tight cases at high baud rates. #### How did you do it? `timeout = overhead_seconds + wire_time`, with `overhead_seconds = 0.1`. Platform-specific multipliers removed since the fixed term makes them unnecessary. 0.1 s covers the observed fixed overhead on an idle test env: SSH RTT through the mgmt LAN (a few switches), sshd + pty + picocom on the DUT, and pexpect's 10 ms poll — typically 15-30 ms, leaving headroom for jitter. #### How did you verify/test it? Ran `test_console_loopback.py` on 4 physical testbeds covering: - Nokia-7215-C1: same-host and diff-host (`c0-lo` and `c0`) - Cisco-C8220TG: same-host and diff-host (`c0-lo` and `c0`) Result: 24 passed, 8 skipped (pingpong skips on same-host by design), 0 failed. #### Any platform specific information? None — the fixed overhead term makes the platform-specific multipliers unnecessary. #### Supported testbed topology if it's a new test case? N/A (existing test). ### Documentation N/A. Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
Collaborator
Author
|
Original PR: sonic-net/sonic-mgmt#25947 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary: Re-evaluate the timeout formula in
test_console_loopbackso it reflects the actual round-trip cost.The old formula
(packet_size * 10) * delay_factor / baud_ratemodels only the on-wire transmission time and scales inversely with baud rate. The real round-trip also includes baud-independent overhead: SSH round-trip through the mgmt LAN, sshd + pty + picocom bridge on the DUT, and pexpect's poll granularity. Splitting the timeout into a fixed term plus a wire-time term is a more accurate model, and lets us drop the platform-specific fudge factors that were compensating for the missing term.Type of change
Back port request
Tracking issue/work item for backport/cherry-pick request:
Failure type:
Approach
What is the motivation for this PR?
The existing formula only accounts for on-wire time, so the timeout shrinks with baud rate even though the fixed SSH/pty/pexpect overhead does not. This forced per-platform multipliers to keep the timeout usable, and still left tight cases at high baud rates.
How did you do it?
timeout = overhead_seconds + wire_time, withoverhead_seconds = 0.1. Platform-specific multipliers removed since the fixed term makes them unnecessary.0.1 s covers the observed fixed overhead on an idle test env: SSH RTT through the mgmt LAN (a few switches), sshd + pty + picocom on the DUT, and pexpect's 10 ms poll — typically 15-30 ms, leaving headroom for jitter.
How did you verify/test it?
Ran
test_console_loopback.pyon 4 physical testbeds covering:c0-loandc0)c0-loandc0)Result: 24 passed, 8 skipped (pingpong skips on same-host by design), 0 failed.
Any platform specific information?
None — the fixed overhead term makes the platform-specific multipliers unnecessary.
Supported testbed topology if it's a new test case?
N/A (existing test).
Documentation
N/A.
Signed-off-by: Sonic Build Admin sonicbld@microsoft.com