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

Optimizing testQosSaiHeadroomPoolSize runtime #8775

Merged
merged 12 commits into from
Aug 17, 2023

Conversation

ansrajpu-git
Copy link
Contributor

@ansrajpu-git ansrajpu-git commented Jun 29, 2023

Description of PR

HeadroomPoolSize was taking more that ~14 mins to complete the test which results in the port flapping while test run

The sleep time added inside the loop contribute a lot to the long running iterations.

Summary:
Below are the changes in 3 loop structure in HeadroomPoolSize test:
1.Loop to fill all pgs_num service pool: Instead of 8 sec sleep every time after send packet and show port. Sleep time is added after packets are sent to all the pgs_num and then added another loop for show_port_counter iterating pgs_num .

2.Loop iterating pgs_num for sending TCP packet: Instead of sleep time every iteration before show_port_counter; Sleep time of 8 sec is allotted for non broadcom-dnx box.

3.Loop to fill all pgs_num headroom pool: Instead of 8 sec sleep every time after send packet and run show port.Sleep time is added after packets are sent to all the pgs_num and added another loop for show_port_counter iterating pgs_num .
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

HeadroomPoolsize test failing with ".....Caught exception socket.timeout: timeout(), , <class 'socket.timeout'>" ERROR in sai_thrift_port_tx_enable..........

Observed that each test takes ~14mins .since the port channel ports are kept tx disabled for that long duration which results in lacp packet drop.This is due to voq credits getting exhausted on the destination port , and port channel bounces

How did you do it?

Reduce the test execution runtime by removing redundant sleep time in the loop.

How did you verify/test it?

Executed qos test cases for T2 topology

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:2303:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2303:121: E501 line too long (200 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2345:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2345:121: E501 line too long (194 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2395:121: E501 line too long (154 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2397:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2397:121: E501 line too long (201 > 120 characters)

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>

1 similar comment
@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:2303:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2303:121: E501 line too long (200 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2345:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2345:121: E501 line too long (194 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2395:121: E501 line too long (154 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2397:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2397:121: E501 line too long (201 > 120 characters)

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>

@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:2303:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2346:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2400:21: E128 continuation line under-indented for visual indent

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>

@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:2303:121: E501 line too long (137 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2304:40: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2346:121: E501 line too long (131 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2347:40: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2400:121: E501 line too long (138 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2401:40: E128 continuation line under-indented for visual indent

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>

1 similar comment
@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:2303:121: E501 line too long (137 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2304:40: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2346:121: E501 line too long (131 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2347:40: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2400:121: E501 line too long (138 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2401:40: E128 continuation line under-indented for visual indent

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>

@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:2305:40: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2349:40: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2404:40: E128 continuation line under-indented for visual indent

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>

@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:2306:21: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2351:40: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2406:40: E128 continuation line under-indented for visual indent

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>

@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:2305:36: E231 missing whitespace after ','
tests/saitests/py3/sai_qos_tests.py:2349:36: E231 missing whitespace after ','
tests/saitests/py3/sai_qos_tests.py:2352:73: E225 missing whitespace around operator
tests/saitests/py3/sai_qos_tests.py:2403:36: E231 missing whitespace after ','

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>

@judyjoseph
Copy link
Contributor

@vmittal-msft Could you check and review this PR ?

@ansrajpu-git ansrajpu-git force-pushed the qos_HdrmPoolSize branch 2 times, most recently from 974a6d1 to 6bdf682 Compare July 28, 2023 15:32
@@ -2269,7 +2269,14 @@ def runTest(self):
send_packet(
self, self.src_port_ids[sidx_dscp_pg_tuples[i][0]], pkt, int(pkt_cnt))

time.sleep(8) # wait pfc counter refresh
time.sleep(8) # wait pfc counter refresh and show the counters
for i in range(0, self.pgs_num):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please modify for voq chassis only and no change for other platforms.

@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:2278:44: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2279:44: E122 continuation line missing indentation or outdented
tests/saitests/py3/sai_qos_tests.py:2293:44: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2328:121: E501 line too long (121 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2389:44: E128 continuation line under-indented for visual indent
tests/saitests/py3/sai_qos_tests.py:2390:44: E122 continuation line missing indentation or outdented
tests/saitests/py3/sai_qos_tests.py:2395:121: E501 line too long (158 > 120 characters)
tests/saitests/py3/sai_qos_tests.py:2399:44: E128 continuation line under-indented for visual indent

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>

@judyjoseph
Copy link
Contributor

@ansrajpu-git Could you confirm the qos tests result with this change with latest master, We can merge it in if things are fine,

@mssonicbld
Copy link
Collaborator

@ansrajpu-git PR conflicts with 202205 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Aug 28, 2023
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #9704

mssonicbld pushed a commit that referenced this pull request Aug 29, 2023
* Optimizing HeadroomPoolSize runtime
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Jan 25, 2024
ansrajpu-git added a commit to ansrajpu-git/sonic-mgmt that referenced this pull request Mar 25, 2024
yxieca pushed a commit that referenced this pull request May 15, 2024
…2159)

* Optimizing HeadroomPoolSize runtime

(cherry picked from commit f35a45c9958716d5ed01f2134a3288ae0119ec48)
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.

5 participants