Skip to content

Conversation

@XuChen-MSFT
Copy link
Contributor

…deployment‘

Description of PR

Summary:
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

Approach

What is the motivation for this PR?

This PR fixes an UnboundLocalError that occurs in the test_buffer_deployment test case when buffer_profile_oid is None.

During test execution on some testbed, the test failed when processing pg_lossless_XXXX_profile because:

  1. The profile is an ingress lossless profile (is_ingress_lossless = True)
  2. buffer_profile_oid returned None from _check_port_buffer_info_and_get_profile_oid
  3. buffer_profile_asic_info was never defined
  4. Code attempted to access buffer_profile_asic_info['SAI_BUFFER_PROFILE_ATTR_POOL_ID'], causing the error

How did you do it?

  • Moved the lossless pool OID validation logic (lines 3088-3096) inside the if buffer_profile_oid: block
  • Ensures buffer_profile_asic_info is only accessed when it has been properly defined
  • Maintains the assignment of profiles_checked[expected_profile] outside the block to preserve existing behavior
    This fix ensures the test handles cases where buffer_profile_oid is None without crashing, allowing the test to continue or fail gracefully with proper assertion messages.

How did you verify/test it?

local test

Any platform specific information?

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

Documentation

@XuChen-MSFT XuChen-MSFT requested review from StormLiangMS, ZhaohuiS and wsycqyz and removed request for nikamirrr, wangxin and yxieca November 27, 2025 13:31
@XuChen-MSFT XuChen-MSFT added Request for 202505 branch Request for 202511 branch Request to backport a change to 202511 branch labels Nov 27, 2025
Copy link
Contributor

@ZhaohuiS ZhaohuiS left a comment

Choose a reason for hiding this comment

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

thanks for the quick fix

Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS StormLiangMS reopened this Dec 2, 2025
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

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

Request for 202505 branch Request for 202511 branch Request to backport a change to 202511 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants