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

[action] [PR:14788] Retry test_psu.py::TestPsuApi::test_power if power not within tolerance #15587

Open
wants to merge 1 commit into
base: 202311
Choose a base branch
from

Conversation

mssonicbld
Copy link
Collaborator

Description of PR

Summary:
If test_psu.py::TestPsuApi::test_power fails on abs(power - (voltage*current)) < power*0.1 then retry the test. The test is repeated for a maximum of three times until it passes, else it is failed. This change is introduced to account for the stringent tolerance level of 10% and the errors that might be caused due to time differences in reading each of the parameters (current, voltage and power).

Fixes # (issue)
Addresses issue: https://github.com/aristanetworks/sonic-qual.msft/issues/209

Type of change

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

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

Improve the test to account for stringent tolerance level and asymmetric reading of parameters for power calculation.

How did you do it?

If the test fails for the condition abs(power - (voltage*current)) < power*0.1, the test will collect fresh parameters (voltage, current and power) from the PSU telemetry and recheck the condition. It is limited to a maximum of 3 attempts.

How did you verify/test it?

Tested internally by varying the tolerance level and verifying the number of api calls.

Any platform specific information?

N/A

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

N/A

Documentation

N/A

…ce (sonic-net#14788)

* Retry test_power calculated power above 10%

If the test fails on `abs(power - (voltage*current)) < power*0.1` then retry the test. Test is repeated for a maximum of three times until it passes, else it is failed.
This change is introduced to account for the stringent tolerance level of 10% and the errors that might be caused due to time differences reading each of the parameters.

* Retry test_power.py::TestPsuApi::test_power if power above tolerance

If the test fails on `abs(power - (voltage*current)) < power*0.1` then retry the test. The test is repeated for a maximum of three times until it passes.
This change is introduced to account for the stringent tolerance level of 10% and the errors that might be caused due to time differences in reading each of the parameters.

* Add check to detect occurrence of a failure before power calculation

* Resolve pre-commit check issue

* Refactor test_power function to improve readability

* Use wait_until function for retry
@mssonicbld
Copy link
Collaborator Author

Original PR: #14788

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.

2 participants