Skip to content

Fix buffer queue cnt test to account for different BUFFER_QUEUE configs #19310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

zbud-msft
Copy link
Contributor

@zbud-msft zbud-msft commented Jul 1, 2025

Description of PR

Summary:
Fixes #19201
MSADO: 33479698

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?

Currently this test does not account for BUFFER_QUEUE configs to have only entry for an interface.

In some SKU's and config

BUFFER_QUEUE may have config such as

"BUFFER_QUEUE": {
    "Ethernet0|0-2": {
        "profile": "egress_lossy_profile"
    },      
    "Ethernet0|3-4": {
        "profile": "egress_lossless_profile"
    },      
    "Ethernet0|5-7": {
        "profile": "egress_lossy_profile"
    }, 

or even

"BUFFER_QUEUE": {
    "Ethernet0|0": {
        "profile": "egress_lossy_profile"
    },      
    "Ethernet0|1": {
        "profile": "egress_lossless_profile"
    },      
    "Ethernet0|2": {
        "profile": "egress_lossy_profile"
    },  ... etc

The test works fine for the above configs.

However if the BUFFER_QUEUE was configured such as

"BUFFER_QUEUE": {
    "Ethernet0|0-9": {
        "profile": "egress_lossy_profile"
    },      
    "Ethernet100|0-9": {
        "profile": "egress_lossless_profile"
    },      
    "Ethernet200|0-9": {
        "profile": "egress_lossy_profile"
    },  

When we delete Ethernet0|0-9 as part of del data['BUFFER_QUEUE'][ interface_buffer_queues[0] ] we end up deleting all queues for that interface from COUNTERS_QUEUE_NAME_MAP which causes check_buffer_queues_cnt_cmd_output to always return false.

This test checks for such edge case and we split the BUFFER_QUEUE config such that we can delete an entry without deleting all entries in the map.

How did you do it?

Code change

How did you verify/test it?

Test on 20241110

01/07/2025 19:00:48 base._run                                L0108 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"failed": true, "changed": true, "end": "2025-07-01 19:00:48.806079", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path\n ------------------------- \n [elem {\n  name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n  name: \"Ethernet0:0\"\n}\n]\nGRPC error\n redis: nil", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "delta": "0:00:00.199525", "stderr": "", "rc": 1, "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:0             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "start": "2025-07-01 19:00:48.606554", "msg": "non-zero return code", "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path", " ------------------------- ", " [elem {", "  name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", "  name: \"Ethernet0:0\"", "}", "]", "GRPC error", " redis: nil"], "stderr_lines": [], "_ansible_no_log": false}
01/07/2025 19:00:48 base._run                                L0071 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1             -xt COUNTERS_DB -o \"xxxxxxxxx\"             "], kwargs={"module_ignore_errors": true}                                                                                                                                                                                                                                                                                                                          01/07/2025 19:00:49 base._run                                L0108 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.227872", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path\n ------------------------- \n [elem {\n  name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n  name: \"Ethernet0:1\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x15000000000679", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "rc": 0, "start": "2025-07-01 19:00:48.981566", "stderr": "", "delta": "0:00:00.246306", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:1             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path", " ------------------------- ", " [elem {", "  name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", "  name: \"Ethernet0:1\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x15000000000679"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
01/07/2025 19:00:49 base._run                                L0071 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2             -xt COUNTERS_DB -o \"xxxxxxxxx\"             "], kwargs={"module_ignore_errors": true}                                                                                                                                                                                                                                                                                                                          01/07/2025 19:00:49 base._run                                L0108 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.614484", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path\n ------------------------- \n [elem {\n  name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n  name: \"Ethernet0:2\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067a", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "rc": 0, "start": "2025-07-01 19:00:49.411463", "stderr": "", "delta": "0:00:00.203021", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:2             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path", " ------------------------- ", " [elem {", "  name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", "  name: \"Ethernet0:2\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067a"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
01/07/2025 19:00:49 base._run                                L0071 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3             -xt COUNTERS_DB -o \"xxxxxxxxx\"             "], kwargs={"module_ignore_errors": true}                                                                                                                                                                                                                                                                                                                          01/07/2025 19:00:50 base._run                                L0108 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:49.997748", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path\n ------------------------- \n [elem {\n  name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n  name: \"Ethernet0:3\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067b", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "rc": 0, "start": "2025-07-01 19:00:49.798159", "stderr": "", "delta": "0:00:00.199589", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:3             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path", " ------------------------- ", " [elem {", "  name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", "  name: \"Ethernet0:3\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067b"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
01/07/2025 19:00:50 base._run                                L0071 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4             -xt COUNTERS_DB -o \"xxxxxxxxx\"             "], kwargs={"module_ignore_errors": true}                                                                                                                                                                                                                                                                                                                          01/07/2025 19:00:50 base._run                                L0108 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.381489", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path\n ------------------------- \n [elem {\n  name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n  name: \"Ethernet0:4\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067c", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "rc": 0, "start": "2025-07-01 19:00:50.177327", "stderr": "", "delta": "0:00:00.204162", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:4             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path", " ------------------------- ", " [elem {", "  name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", "  name: \"Ethernet0:4\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067c"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
01/07/2025 19:00:50 base._run                                L0071 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5             -xt COUNTERS_DB -o \"xxxxxxxxx\"             "], kwargs={"module_ignore_errors": true}                                                                                                                                                                                                                                                                                                                          01/07/2025 19:00:50 base._run                                L0108 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:50.771962", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path\n ------------------------- \n [elem {\n  name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n  name: \"Ethernet0:5\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067d", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "rc": 0, "start": "2025-07-01 19:00:50.566323", "stderr": "", "delta": "0:00:00.205639", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:5             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "removes": null, "argv": null, "warn": true, "chdir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path", " ------------------------- ", " [elem {", "  name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", "  name: \"Ethernet0:5\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067d"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}
01/07/2025 19:00:50 base._run                                L0071 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell, args=["python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6             -xt COUNTERS_DB -o \"xxxxxxxxx\"             "], kwargs={"module_ignore_errors": true}                                                                                                                                                                                                                                                                                                                          01/07/2025 19:00:51 base._run                                L0108 DEBUG  | /var/src/sonic-mgmt-int/tests/telemetry/test_telemetry.py::get_buffer_queues_cnt#47: [xxxxx-x] AnsibleModule::shell Result => {"changed": true, "end": "2025-07-01 19:00:51.236571", "stdout": "Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path\n ------------------------- \n [elem {\n  name: \"COUNTERS_QUEUE_NAME_MAP\"\n}\nelem {\n  name: \"Ethernet0:6\"\n}\n]\nThe GetResponse is below\n-------------------------\n\noid:0x1500000000067e", "cmd": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "rc": 0, "start": "2025-07-01 19:00:50.951268", "stderr": "", "delta": "0:00:00.285303", "invocation": {"module_args": {"creates": null, "executable": null, "_uses_shell": true, "strip_empty_ends": true, "_raw_params": "python /root/gnxi/gnmi_cli_py/py_gnmicli.py -g -t xx.xx.xxx.xxx             -p 50051 -m get -x COUNTERS_QUEUE_NAME_MAP/Ethernet0:6             -xt COUNTERS_DB -o \"xxxxxxxxx\"             ", "removes": null, "argv": null, "warn": true, "choir": null, "stdin_add_newline": true, "stdin": null}}, "stdout_lines": ["Performing GetRequest, encoding=JSON_IETF to xx.xx.xxx.xxx  with the following gNMI Path", " ------------------------- ", " [elem {", "  name: \"COUNTERS_QUEUE_NAME_MAP\"", "}", "elem {", "  name: \"Ethernet0:6\"", "}", "]", "The GetResponse is below", "-------------------------", "", "oid:0x1500000000067e"], "stderr_lines": [], "_ansible_no_log": false, "failed": false}

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@developfast developfast left a comment

Choose a reason for hiding this comment

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

as comments

@@ -31,7 +31,8 @@

def load_new_cfg(duthost, data):
duthost.copy(content=json.dumps(data, indent=4), dest=CFG_DB_PATH)
config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True, wait_for_bgp=True)
config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True,
wait_for_bgp=True, yang_validate=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

is the yang_validate to False intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, after modifying BUFFER_QUEUE and doing config reload, we will skip yang validation.

"""If all queues for that pool are in the same pool ex Ethernet0|0-9
We will modify to separate the first queue and the remaining such
that we get a separate entry for Ethernet0|0 and Ethernet0|1-9"""
single_key = False
Copy link
Contributor

Choose a reason for hiding this comment

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

The variable name single_key is misleading. It actually indicates whether we have a single queue (not a range). Consider renaming to is_single_queue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed and changed.

We will modify to separate the first queue and the remaining such
that we get a separate entry for Ethernet0|0 and Ethernet0|1-9"""
single_key = False
bq_entry = interface_buffer_queues[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a check to ensure interface_buffer_queues is not empty before accessing interface_buffer_queues[0]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

del data['BUFFER_QUEUE'][bq_entry]
bq_entry = single_queue_entry
else:
pytest.skip("Invalid buffer queue range")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the logic here is pretty useful for other use cases too. Wanna split the logic out into a helper func to make it more readable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can take this effort in some future PR.

= "true"
load_new_cfg(duthost, data)
pytest_assert(wait_until(120, 20, 0, check_buffer_queues_cnt_cmd_output, ptfhost, gnxi_path,
dut_ip, interface_to_check, env.gnmi_port), "Unable to get map data")
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make the failure message more specific?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures the buffer‐queue count test correctly handles configurations where all queues for an interface are defined in a single range (e.g., Ethernet0|0-9) by splitting that range before removal, and adds a parameter to disable YANG validation on reload.

  • Pass yang_validate=False into config_reload to skip YANG validation during test config loads.
  • Before removing a buffer‐queue entry, detect and split grouped queue ranges into a single‐queue entry and a remaining range.
  • Wrap the removal and assertions in a try/finally to restore the original configuration regardless of test outcome.
Comments suppressed due to low confidence (1)

tests/telemetry/test_telemetry.py:34

  • [nitpick] Add a brief inline comment explaining why yang_validate=False is required here (e.g., to bypass YANG schema checks for test changes).
    config_reload(duthost, config_source='config_db', safe_reload=True, check_intf_up_ports=True,

Comment on lines +192 to +194
"""If all queues for that pool are in the same pool ex Ethernet0|0-9
We will modify to separate the first queue and the remaining such
that we get a separate entry for Ethernet0|0 and Ethernet0|1-9"""
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

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

[nitpick] This triple-quoted string is a hanging literal used as a comment. Replace it with standard # comments to avoid leaving unused string literals in the function body.

Suggested change
"""If all queues for that pool are in the same pool ex Ethernet0|0-9
We will modify to separate the first queue and the remaining such
that we get a separate entry for Ethernet0|0 and Ethernet0|1-9"""
# If all queues for that pool are in the same pool, e.g., Ethernet0|0-9,
# we will modify to separate the first queue and the remaining such
# that we get a separate entry for Ethernet0|0 and Ethernet0|1-9.

Copilot uses AI. Check for mistakes.

@zbud-msft zbud-msft requested review from make1980 and qiluo-msft July 2, 2025 23:08
Copy link

@make1980 make1980 left a comment

Choose a reason for hiding this comment

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

:shipit:

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.

Bug: test_telemetry_queue_buffer_cnt test does not account for a single BUFFER_QUEUE entry for an interface
4 participants