Skip to content

Fix ECN config update test skipping WRED profile validation (#23597)#23598

Closed
yxieca wants to merge 1 commit into
sonic-net:masterfrom
yxieca:fix/ecn-config-skip-validation
Closed

Fix ECN config update test skipping WRED profile validation (#23597)#23598
yxieca wants to merge 1 commit into
sonic-net:masterfrom
yxieca:fix/ecn-config-skip-validation

Conversation

@yxieca
Copy link
Copy Markdown
Collaborator

@yxieca yxieca commented Apr 3, 2026

Description of PR

Summary:
Fix test_ecn_config_updates[None-replace-green_max_threshold] failure introduced by PR #23319. When WRED profiles have zero deltas, their expected values were excluded from ASIC DB validation, causing sorted comparison to fail due to list length mismatch.

Fixes #23597

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?

PR #23319 introduced ECN config update tests that generate JSON patches for WRED profile modifications. When a WRED profile has zero deltas (current value is already at the boundary, so no change is possible), it is correctly skipped during patch generation. However, the expected values dict (new_values) also excluded these profiles. Since ASIC DB contains entries for all WRED profiles, the sorted comparison between ASIC DB values and expected values fails — the lists have different lengths.

How did you do it?

Include skipped profiles' current (unchanged) values in new_values so the ASIC DB comparison accounts for all WRED profiles, not just the modified ones.

How did you verify/test it?

Tested on local KVM T0 testbed — test_ecn_config_updates[None-replace-green_max_threshold] passes with the fix.

Any platform specific information?

N/A — generic test framework fix.

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

N/A — bug fix.

Documentation

N/A


This PR was generated with the assistance of an AI agent on behalf of @yxieca.

When WRED profiles with zero deltas are skipped during patch generation,
their expected values were also excluded from ASIC DB validation. This
caused the validation to fail because the ASIC DB contains entries for
all profiles but the expected values dict only contained modified ones.

Fix by including skipped profiles' current values in new_values so the
ASIC DB comparison accounts for all WRED profiles.

Fixes sonic-net#23597

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca
Copy link
Copy Markdown
Collaborator Author

yxieca commented Apr 3, 2026

🤖 This PR was generated with the assistance of an AI agent (OpenClaw/sonic-mgmt).

Issue: #23597 — ECN config update test failure after PR #23319 merged

Root cause: When WRED profiles have zero deltas (e.g., Q4/Q5 with identical min/max thresholds), they are correctly skipped during JSON patch generation but were also excluded from the expected values dictionary. The ASIC DB validation then fails because it compares all WRED objects against only the modified subset.

Fix: Include skipped profiles' current values in the expected values dictionary so the validation comparison is complete.

@yxieca
Copy link
Copy Markdown
Collaborator Author

yxieca commented May 15, 2026

Closing this PR — superseded by #24532 (merged May 12), which fixes the same issue by skipping WRED profiles with wred_green_enabled=false entirely, preventing the delta=0 validation gap.

Issue #23597 should be resolved by #24532 as well.

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.

Bug: Case test_ecn_config_updates[None-replace-green_max_threshold] failure after PR https://github.com/sonic-net/sonic-mgmt/pull/23319 merged

2 participants