Skip to content

Fix qos/test_qos_dscp_mapping.py#13119

Merged
yxieca merged 2 commits intosonic-net:masterfrom
vkjammala-arista:test-qos-dscp-mapping
Jun 11, 2024
Merged

Fix qos/test_qos_dscp_mapping.py#13119
yxieca merged 2 commits intosonic-net:masterfrom
vkjammala-arista:test-qos-dscp-mapping

Conversation

@vkjammala-arista
Copy link
Contributor

Description of PR

Summary: Fix qos/test_qos_dscp_mapping.py failures
Fixes # aristanetworks/sonic-qual.msft#132

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?

This test is mainly failing due to:

  • Sending 10K packets at once on a ptf interface is sometimes causing nnpy socket to be non-functional for a moment and connection is getting timedout (logic to timeout is introduced by Add a send timeout to nnpy sockets. p4lang/ptf#183).
  • Sometimes egress_queue_count on queue 7 is way greater than no of packets being sent and the queue_count is not within the TOLERANCE, this could be due to protocol packets.
  • Test is not enhanced to be run on dualtor topologies (packets are going to unexpected ToR).
  • Fixtures "upstream_links" and "downstream_links" are always referring to upper ToR, thus return values of these fixtures is not really considering the ToR type and causing failures.

How did you do it?

Fixes involve adding right fixtures to the test methods (to consider dualtor topologies) and minor changes to address above issues.

How did you verify/test it?

With the fix test is passing well (earlier it was failing most of the times with one or other reason). Verified the fix on Arista-7260CX3-C64 202311 branch.

Any platform specific information?

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

Documentation

This test is mainly failing due to:
   - Sending 10K packets at once on a ptf interface is causing nnpy
     socket to be non-functional for a moment sometimes and connection
     is getting timedout.
   - Sometimes egress_queue_count on queue 7 is way greater than no of
     packets being sent and the queue_count is not within the TOLERANCE,
     this could be due to protocol packets.
   - Test is not enhanced to be run on dualtor topologies (packets are
     going to unexpected ToR).
   - Fixtures "upstream_links" and "downstream_links" are always
     referring to upper ToR, thus return values of these fixtures is not
     really considering the ToR type and causing failures.
@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/qos/test_qos_dscp_mapping.py:14:1: F401 'tests.common.dualtor.mux_simulator_control.toggle_all_simulator_ports_to_rand_selected_tor' imported but unused
tests/qos/test_qos_dscp_mapping.py:340:46: F811 redefinition of unused 'toggle_all_simulator_ports_to_rand_selected_tor' from line 14
tests/qos/test_qos_dscp_mapping.py:352:49: F811 redefinition of unused 'toggle_all_simulator_ports_to_rand_selected_tor' from line 14

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>

@wsycqyz
Copy link
Contributor

wsycqyz commented Jun 5, 2024

The pre-commit check is mandatory. Please check.

pre-commit check is being failed with
"toggle_all_simulator_ports_to_rand_selected_tor" imported but unused
error. Added "# noqa" to suppress this failure as this import is being
used as fixture argument (similar to other tests).
@vkjammala-arista
Copy link
Contributor Author

The pre-commit check is mandatory. Please check.

The pre-commit check is mandatory. Please check.

Thanks took care of this.

@wsycqyz
Copy link
Contributor

wsycqyz commented Jun 6, 2024

@XuChen-MSFT FYI

@wsycqyz
Copy link
Contributor

wsycqyz commented Jun 6, 2024

@vkjammala-arista Do you need to backport to 202311 branch?

Copy link
Contributor

@wsycqyz wsycqyz 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
Copy link
Collaborator

hi @XuChen-MSFT @developfast could you help to review this PR also?

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.

changes lgtm - thanks for the fixture change to provide support on dualtor

@developfast
Copy link
Contributor

@yxieca can you pls help merge?

@yxieca yxieca merged commit 8674741 into sonic-net:master Jun 11, 2024
@vkjammala-arista
Copy link
Contributor Author

@vkjammala-arista Do you need to backport to 202311 branch?

Hi @wsycqyz, we need this fix in 202311 as well (as mentioned in description). Thanks!

@vkjammala-arista vkjammala-arista deleted the test-qos-dscp-mapping branch June 12, 2024 04:08
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jun 12, 2024
* Fix qos/test_qos_dscp_mapping.py

This test is mainly failing due to:
   - Sending 10K packets at once on a ptf interface is causing nnpy
     socket to be non-functional for a moment sometimes and connection
     is getting timedout.
   - Sometimes egress_queue_count on queue 7 is way greater than no of
     packets being sent and the queue_count is not within the TOLERANCE,
     this could be due to protocol packets.
   - Test is not enhanced to be run on dualtor topologies (packets are
     going to unexpected ToR).
   - Fixtures "upstream_links" and "downstream_links" are always
     referring to upper ToR, thus return values of these fixtures is not
     really considering the ToR type and causing failures.

* Fix pre-commit check failures

pre-commit check is being failed with
"toggle_all_simulator_ports_to_rand_selected_tor" imported but unused
error. Added "# noqa" to suppress this failure as this import is being
used as fixture argument (similar to other tests).
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #13247

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jun 13, 2024
* Fix qos/test_qos_dscp_mapping.py

This test is mainly failing due to:
   - Sending 10K packets at once on a ptf interface is causing nnpy
     socket to be non-functional for a moment sometimes and connection
     is getting timedout.
   - Sometimes egress_queue_count on queue 7 is way greater than no of
     packets being sent and the queue_count is not within the TOLERANCE,
     this could be due to protocol packets.
   - Test is not enhanced to be run on dualtor topologies (packets are
     going to unexpected ToR).
   - Fixtures "upstream_links" and "downstream_links" are always
     referring to upper ToR, thus return values of these fixtures is not
     really considering the ToR type and causing failures.

* Fix pre-commit check failures

pre-commit check is being failed with
"toggle_all_simulator_ports_to_rand_selected_tor" imported but unused
error. Added "# noqa" to suppress this failure as this import is being
used as fixture argument (similar to other tests).
@mssonicbld
Copy link
Collaborator

@vkjammala-arista PR conflicts with 202305 branch

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #13260

@StormLiangMS
Copy link
Collaborator

hi @vkjammala-arista, could you file separate PR for 202305, it is a conflict.

@vkjammala-arista
Copy link
Contributor Author

hi @vkjammala-arista, could you file separate PR for 202305, it is a conflict.

Hi @StormLiangMS, this change is NA for 202305 (test doesn't exist there). Thanks!

mssonicbld pushed a commit that referenced this pull request Jun 13, 2024
* Fix qos/test_qos_dscp_mapping.py

This test is mainly failing due to:
   - Sending 10K packets at once on a ptf interface is causing nnpy
     socket to be non-functional for a moment sometimes and connection
     is getting timedout.
   - Sometimes egress_queue_count on queue 7 is way greater than no of
     packets being sent and the queue_count is not within the TOLERANCE,
     this could be due to protocol packets.
   - Test is not enhanced to be run on dualtor topologies (packets are
     going to unexpected ToR).
   - Fixtures "upstream_links" and "downstream_links" are always
     referring to upper ToR, thus return values of these fixtures is not
     really considering the ToR type and causing failures.

* Fix pre-commit check failures

pre-commit check is being failed with
"toggle_all_simulator_ports_to_rand_selected_tor" imported but unused
error. Added "# noqa" to suppress this failure as this import is being
used as fixture argument (similar to other tests).
mssonicbld pushed a commit that referenced this pull request Jun 15, 2024
* Fix qos/test_qos_dscp_mapping.py

This test is mainly failing due to:
   - Sending 10K packets at once on a ptf interface is causing nnpy
     socket to be non-functional for a moment sometimes and connection
     is getting timedout.
   - Sometimes egress_queue_count on queue 7 is way greater than no of
     packets being sent and the queue_count is not within the TOLERANCE,
     this could be due to protocol packets.
   - Test is not enhanced to be run on dualtor topologies (packets are
     going to unexpected ToR).
   - Fixtures "upstream_links" and "downstream_links" are always
     referring to upper ToR, thus return values of these fixtures is not
     really considering the ToR type and causing failures.

* Fix pre-commit check failures

pre-commit check is being failed with
"toggle_all_simulator_ports_to_rand_selected_tor" imported but unused
error. Added "# noqa" to suppress this failure as this import is being
used as fixture argument (similar to other tests).
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