Skip to content
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

Test polling only configured buffer queue counters #11941

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

arfeigin
Copy link
Contributor

Description of PR

This test is checking that buffer queue counters inside snmp docker are inline when using create_only_config_db_counters optimization.

Summary:
Accompanies "Fix SNMP dropping some of the queue counter when create_only_config_db_buffers is set to true" (sonic-net/sonic-snmpagent#303) which fixes the issue: "The feature "polling only configured ports buffer queue" will break SNMP" (sonic-net/sonic-buildimage#17448).

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

To enhance the bug fix mentioned above, solving an issue with buffer queue counters optimization.

How did you do it?

  • Set "create_only_config_db_buffers" to true in config db, to create only relevant counters
  • Remove one of the buffer queues, Ethernet0|3-4 is chosen arbitrary
  • Using snmpwalk compare number of queue counters on Ethernet0, assuming there will be 8 less after removing the buffer. (Assuming unicast only, 4 counters for each queue in this case)

How did you verify/test it?

Run the test multiple times on various setups.
Run the test while reverting the fix mentioned above to see the different result.

Any platform specific information?

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

Any

Documentation

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/snmp/test_snmp_queue_counters.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/snmp/test_snmp_queue_counters.py:17:1: E302 expected 2 blank lines, found 1
tests/snmp/test_snmp_queue_counters.py:21:1: E302 expected 2 blank lines, found 1
tests/snmp/test_snmp_queue_counters.py:24:1: E302 expected 2 blank lines, found 1
tests/snmp/test_snmp_queue_counters.py:60:121: E501 line too long (121 > 120 characters)
tests/snmp/test_snmp_queue_counters.py:61:5: E128 continuation line under-indented for visual indent
...
[truncated extra lines, please run pre-commit locally to view full check results]

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@dprital dprital requested a review from qiluo-msft March 12, 2024 08:04
@dprital
Copy link

dprital commented Mar 17, 2024

@qiluo-msft , can you please review this PR ?

@liat-grozovik
Copy link
Collaborator

@SuvarnaMeenakshi @qiluo-msft please help to review.

@qiluo-msft qiluo-msft merged commit 582510e into sonic-net:master Apr 16, 2024
13 checks passed
@yutongzhang-microsoft
Copy link
Contributor

@arfeigin
Copy link
Contributor Author

Hi, @arfeigin , this script fails on kvm testbed, can you help us double check?

https://elastictest.org/scheduler/testplan/66a1da787efd0bb46f79e610?searchTestCase=snmp&testcase=snmp%2Ftest_snmp_queue_counters.py&type=console

Hi @yutongzhang-microsoft , I don't have access to see the failure.
image
Can you share more details please?

@yutongzhang-microsoft
Copy link
Contributor

yutongzhang-microsoft commented Jul 29, 2024

@arfeigin Here is the short test summary info

================================================================= short test summary info ==================================================================
ERROR snmp/test_snmp_queue_counters.py::test_snmp_queue_counters[vlab-01] - Failed: Processes "['analyze_logs--']" failed with exit code "1"
FAILED snmp/test_snmp_queue_counters.py::test_snmp_queue_counters[vlab-01] - KeyError: 'Ethernet0|3-4'
==================================================== 1 failed, 1 warning, 1 error in 317.19s (0:05:17) =====================================================
INFO:root:Can not get Allure report URL. Please check logs

05:35:06 __init__.pytest_runtest_call             L0040 ERROR  | Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/_pytest/python.py", line 1788, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/usr/local/lib/python3.8/dist-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  File "/usr/local/lib/python3.8/dist-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/local/lib/python3.8/dist-packages/pluggy/_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/usr/local/lib/python3.8/dist-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.8/dist-packages/_pytest/python.py", line 194, in pytest_pyfunc_call
    result = testfunction(**testargs)
  File "/var/src/sonic-mgmt/tests/snmp/test_snmp_queue_counters.py", line 66, in test_snmp_queue_counters
    del data['BUFFER_QUEUE']["Ethernet0|3-4"]
KeyError: 'Ethernet0|3-4'
image

@bingwang-ms
Copy link
Collaborator

I added the label for cherry-pick request. @arfeigin Can you please check the error and notify me if the error is fixed so that I will proceed with the cherry-pick?

@arfeigin
Copy link
Contributor Author

It looks like it fails as test to delete buffer queue that is not present on the specific setup, I can try and make it more generic or avoid deletion if this buffer queue does not exist.

@yutongzhang-microsoft
Copy link
Contributor

It looks like it fails as test to delete buffer queue that is not present on the specific setup, I can try and make it more generic or avoid deletion if this buffer queue does not exist.

Can I create an issue for you?

@yutongzhang-microsoft
Copy link
Contributor

It looks like it fails as test to delete buffer queue that is not present on the specific setup, I can try and make it more generic or avoid deletion if this buffer queue does not exist.

Can I create an issue for you?

Create an issue #14007

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.

7 participants