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

Adding COUNTER_MARGIN to Ingress drop counters for qos tests #9896

Merged
merged 7 commits into from
Sep 25, 2023

Conversation

ansrajpu-git
Copy link
Contributor

Description of PR

Adding COUNTER_MARGIN to ingress drop counter for below test scenarios to avoid flakey results.

  • TestQosSai.testQosSaiPfcXoffLimit
  • TestQosSai.testQosSaiPfcXonLimit
  • TestQosSai.testQosSaiLossyQueue

Summary:
Sometimes for dnx, few extra ipv6 NS/RA pkt received from VM which get added to counter value & may give inconsistent test results.
Adding COUNTER_MARGIN to provide room to 2 extra pkt incase, extra traffic received. This will avoid inconsistent results on qos test.
Below tests are updated:

  • TestQosSai.testQosSaiPfcXoffLimit
  • TestQosSai.testQosSaiPfcXonLimit
  • TestQosSai.testQosSaiLossyQueue
    Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

Sometimes for dnx, few extra ipv6 NS/RA pkt received from VM which get added to counter value & may give inconsistent test results.
Providing room for 2 pkts (COUNTER_MARGIN) incase, extra traffic received.
Below test are updated:

  • TestQosSai.testQosSaiPfcXoffLimit
  • TestQosSai.testQosSaiPfcXonLimit
  • TestQosSai.testQosSaiLossyQueue

What is the motivation for this PR?

Inconsistent results on qos test runs

How did you do it?

How did you verify/test it?

Executed qos tests & verify the results.

Any platform specific information?

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

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.................................................Passed
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/saitests/py3/sai_qos_tests.py:1314:121: E501 line too long (125 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:1347:121: E501 line too long (125 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:1381:121: E501 line too long (125 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:1414:121: E501 line too long (125 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:1419:21: E122 continuation line missing indentation or outdented
tests/saitests/py3/sai_qos_tests.py:1421:121: E501 line too long (142 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:1424:121: E501 line too long (135 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:1859:9: F841 local variable 'max_buffer_size' is assigned to but never used
tests/saitests/py3/sai_qos_tests.py:2135:121: E501 line too long (125 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:3361:26: E211 whitespace before '('
tests/saitests/py3/sai_qos_tests.py:3361:73: E225 missing whitespace around operator
...
[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>

for cntr in egress_counters:
assert (xmit_counters[cntr] == xmit_counters_base[cntr]
), 'unexpectedly TX drop counter increase, {}'.format(test_stage)
# For dnx few extra ipv6 NS/RA pkt received from VM, adding to counter value
Copy link
Contributor

Choose a reason for hiding this comment

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

@ansrajpu-git Original code is stating these counters not supported for DNX. Is this not the case ?

Choose a reason for hiding this comment

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

@ansrajpu-git Original code is stating these counters not supported for DNX. Is this not the case ?

vineet, these drop counters were not supported initially and they are supported now. So enabling the check

@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.................................................Passed
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/saitests/py3/sai_qos_tests.py:3393:30: E211 whitespace before '('
tests/saitests/py3/sai_qos_tests.py:3393:77: E225 missing whitespace around operator
tests/saitests/py3/sai_qos_tests.py:3393:121: E501 line too long (140 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:3393:124: E231 missing whitespace after ','

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

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>

@vmittal-msft vmittal-msft merged commit a7be8e0 into sonic-net:master Sep 25, 2023
12 checks passed
@judyjoseph
Copy link
Contributor

@ansrajpu-git Could you raise a separate PR 202205 branch ? as there are conflicts

ansrajpu-git added a commit to ansrajpu-git/sonic-mgmt that referenced this pull request Oct 2, 2023
…for qos tests (sonic-net#9896)

* Qos_LossyQueueTest fix_adding COUNTER MARGIN

* Adding COUNTER_MARGIN to qos PFCXonTest

* Adding COUNTER_MARGIN to qos PFCTest

* Flake8 fixes

* testQosSaiPFCXoffLimit updated with correct check

* Conditional check corrected for LossyQueueTest

* flake8 fix
wangxin pushed a commit that referenced this pull request Oct 19, 2023
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 19, 2023
…et#9896)

* Qos_LossyQueueTest fix_adding COUNTER MARGIN

* Adding COUNTER_MARGIN to qos PFCXonTest

* Adding COUNTER_MARGIN to qos PFCTest

* Flake8 fixes

* testQosSaiPFCXoffLimit updated with correct check

* Conditional check corrected for LossyQueueTest

* flake8 fix
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #10390

mssonicbld pushed a commit that referenced this pull request Oct 20, 2023
* Qos_LossyQueueTest fix_adding COUNTER MARGIN

* Adding COUNTER_MARGIN to qos PFCXonTest

* Adding COUNTER_MARGIN to qos PFCTest

* Flake8 fixes

* testQosSaiPFCXoffLimit updated with correct check

* Conditional check corrected for LossyQueueTest

* flake8 fix
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
…et#9896)

* Qos_LossyQueueTest fix_adding COUNTER MARGIN

* Adding COUNTER_MARGIN to qos PFCXonTest

* Adding COUNTER_MARGIN to qos PFCTest

* Flake8 fixes

* testQosSaiPFCXoffLimit updated with correct check

* Conditional check corrected for LossyQueueTest

* flake8 fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants