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

[202405] Fix intermittent issue on reboot in test_lldp_syncd

Open veronica-arista opened this issue 1 year ago • 1 comments

Description of PR

At the start of test_lldp_syncd.py::test_lldp_entry_table_after_reboot the test polls and checks that LLDP_ENTRY_TABLE keys match show lldp table output.

The eth0 port is added last so sometimes the entry keys will have it but the lldp table output will not. From debugging, this is the case since the end of the previous test (I put a check on the keys vs lldp table output and observed the missing eth0 at the end of test_lldp_syncd.py::test_lldp_entry_table_after_lldp_restart). From our test results, this issue hits both fixed and modular, but appears to be more easily reproduced on fixed systems.

Added a wait_until at the start of test_lldp_entry_table_after_reboot to wait until the LLDP_ENTRY_TABLE keys match show lldp table output before the tests starts to reboot.

Summary: Fixes # (issue)

Type of change

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

Back port request

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

Approach

What is the motivation for this PR?

Observed another intermittent issue in test_lldp_syncd in addition to the issues fixed by https://github.com/sonic-net/sonic-mgmt/pull/15258.

How did you do it?

How did you verify/test it?

Verified the test on one of our fixed system by running test 50 times with this change and PR#15258 to ensure all the intermittent fails are gone.

Any platform specific information?

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

Documentation

veronica-arista avatar Nov 01 '24 23:11 veronica-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.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/lldp/test_lldp_syncd.py

fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Passed
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 Nov 01 '24 23:11 mssonicbld

@veronica-arista there is conflict in your PR. could you please check? I also had a PR to address this mismatch issue after restart lldp. https://github.com/sonic-net/sonic-mgmt/pull/15337 But I think your check is not harmful.

ZhaohuiS avatar Nov 07 '24 06:11 ZhaohuiS

@ZhaohuiS thanks, I fixed the merge conflict.

veronica-arista avatar Nov 07 '24 16:11 veronica-arista

/Azp run Azure.sonic-mgmt

arlakshm avatar Nov 11 '24 20:11 arlakshm

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 11 '24 20:11 azure-pipelines[bot]

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

mssonicbld avatar Nov 13 '24 08:11 mssonicbld