Skip to content

[mmu probing] pr10.test: Add supplementary UTs and IT for review findings#23341

Open
XuChen-MSFT wants to merge 3 commits intosonic-net:masterfrom
XuChen-MSFT:xuchen3/mmu_probe/pr10-supplementary-tests
Open

[mmu probing] pr10.test: Add supplementary UTs and IT for review findings#23341
XuChen-MSFT wants to merge 3 commits intosonic-net:masterfrom
XuChen-MSFT:xuchen3/mmu_probe/pr10-supplementary-tests

Conversation

@XuChen-MSFT
Copy link
Copy Markdown
Contributor

Description of PR

Summary:

Supplementary unit tests and integration tests for the MMU threshold probing framework,
covering edge cases identified during review of PR #22540.

Test Changes:

  • 2 new UTs for lower bound minimum value return (order 8350-8351)
  • 3 updated UTs to align expected behavior: return 1 instead of None (order 8260, 8270, 8340)
  • 1 new IT for PFC XOFF probing at threshold=1 boundary

Validates fix in PR #22540: lower bound algorithm returns 1 instead of None when threshold
is triggered at minimum packet count.

Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

qos refactoring - supplementary tests for review findings

How did you do it?

How did you verify/test it?

TDD: RED (3 UT + 1 IT fail before fix) → GREEN (all pass after fix) → REGRESSION (444 UT + 58 IT pass)

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

relevant PRs:
[mmu probing] pr02.probe: Add core probing algorithms
[mmu probing] pr01-pr09 series

3 new/updated UTs for LowerBoundProbingAlgorithm:
- test_lower_bound_returns_1_when_threshold_always_triggered (order 8350)
- test_lower_bound_returns_1_with_various_upper_bounds (order 8351)
- Updated test_run_no_infinite_loop_at_current_one (order 8340): assert 1 not None
- Updated test_run_maximum_iterations_exceeded (order 8260): assert 1 not None
- Updated test_run_reaches_minimum_value (order 8270): assert 1 not None

1 new IT for PfcXoffProbing:
- test_pfc_xoff_lower_bound_returns_value_not_none: threshold=1, verify
  probe succeeds with lower_bound=1 instead of failing

Validates fix in PR sonic-net#22540: lower bound returns 1 instead of None when
threshold triggered at minimum packet count.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Xu Chen <xuchen3@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

…istency

2 new UTs for ThresholdRangeProbingAlgorithm:
- test_backtrack_nudge_bounds_check (order 8890): verifies max(0,...) prevents
  negative merged_start when nudging near lower_bound=0
- test_precision_int_consistency (order 8891): verifies int() wrapper on
  precision target for type-consistent comparison

1 updated UT:
- test_precision_check_at_small_threshold_with_bad_spot (order 8870): updated
  expectation for max(0,...) bounds check interaction with backtrack near 0

Validates fix in PR sonic-net#22540: backtrack nudge bounds + precision int.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Xu Chen <xuchen3@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@XuChen-MSFT XuChen-MSFT requested review from StormLiangMS, ZhaohuiS, lipxu, wsycqyz and yxieca and removed request for lipxu March 26, 2026 08:05
F541: f-string is missing placeholders at test_pfc_xoff_probing.py:1128.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Xu Chen <xuchen3@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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