sonic-mgmt
sonic-mgmt copied to clipboard
Subject: sonic-mgmt: fix tagged-arp test for large topos
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.
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:
- 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.
- Ensure that the
pre-commitpackage is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
Checking pre-commit...
@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.
hi @Janetxxx do we still see failure with internal runs?
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.
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.
hi @yxieca need cherry pick.
Cherry-pick PR to 202311: https://github.com/sonic-net/sonic-mgmt/pull/15023
Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-mgmt/pull/15024