sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Subject: sonic-mgmt: fix tagged-arp test for large topos

Open ccroy-arista opened this issue 1 year ago • 3 comments

Description of PR

Summary: For large topos, i.e. those with a large number of interfaces, there exists a likely possibility that show arp will not be up to date when the call is made.

Try the show arp command again before moving on.

Type of change

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

Back port request

  • [ ] 202012
  • [ ] 202205
  • [ ] 202305
  • [x] 202311
  • [x] 202405

Approach

What is the motivation for this PR?

Fix test failure for topos with large number of interfaces.

How did you do it?

Wrapped the arp entry check in a wait_until, which will attempt the show arp command a few times on a given interface before failing.

How did you verify/test it?

Ran the offending test (tests/arp/test_tagged_arp.py) several times and confirmed that failure was not observed and that the test passed every time.

Any platform specific information?

Verified on Arista-7060X6-64PE-256x200G.

ccroy-arista avatar Sep 03 '24 17:09 ccroy-arista

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/arp/test_tagged_arp.py:91:1: E302 expected 2 blank lines, found 1
tests/arp/test_tagged_arp.py:92:27: E703 statement ends with a semicolon
tests/arp/test_tagged_arp.py:122:20: E703 statement ends with a semicolon
tests/arp/test_tagged_arp.py:128:1: E302 expected 2 blank lines, found 1
tests/arp/test_tagged_arp.py:159:121: E501 line too long (126 > 120 characters)

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>

mssonicbld avatar Sep 03 '24 17:09 mssonicbld

Checking pre-commit...

ccroy-arista avatar Sep 03 '24 21:09 ccroy-arista

@ccroy-arista I cherry-picked this PR and ran the test, but received an AssertionError: Expected 10 entries, but 0 found. It seems ARP packets have not been received by the DUT for some reason. I'll ping you offline to discuss it further. Thanks.

Janetxxx avatar Sep 06 '24 08:09 Janetxxx

hi @Janetxxx do we still see failure with internal runs?

StormLiangMS avatar Sep 19 '24 14:09 StormLiangMS

hi @Janetxxx do we still see failure with internal runs?

Hi @StormLiangMS , It still failed in our internal run, I'll have a look in the next coming days.

Janetxxx avatar Sep 20 '24 00:09 Janetxxx

since the issue on our side is caused by different things from the issue being fixed here, let's get this merged, because eventually we will hit this anyway.

r12f avatar Sep 23 '24 17:09 r12f

hi @yxieca need cherry pick.

StormLiangMS avatar Oct 17 '24 02:10 StormLiangMS

Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/15023

mssonicbld avatar Oct 17 '24 04:10 mssonicbld

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-mgmt/pull/15024

mssonicbld avatar Oct 17 '24 04:10 mssonicbld