Skip to content

[action] [PR:25947] [C0] Update timeout fomula for test_console_loopback#1289

Merged
mssonicbld merged 1 commit into
Azure:202603from
mssonicbld:cherry/msft-202603/25947
Jul 7, 2026
Merged

[action] [PR:25947] [C0] Update timeout fomula for test_console_loopback#1289
mssonicbld merged 1 commit into
Azure:202603from
mssonicbld:cherry/msft-202603/25947

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

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
  • 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

<!--
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>
@mssonicbld

Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-mgmt#25947

@mssonicbld

Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@mssonicbld mssonicbld merged commit f51e563 into Azure:202603 Jul 7, 2026
4 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.

1 participant