-
Notifications
You must be signed in to change notification settings - Fork 712
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
Retry test_psu.py::TestPsuApi::test_power if power not within tolerance #14788
base: master
Are you sure you want to change the base?
Retry test_psu.py::TestPsuApi::test_power if power not within tolerance #14788
Conversation
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.
The pre-commit check detected issues in the files touched by this pull request. Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
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.
/azpw run Azure.sonic-mgmt |
/AzurePipelines run Azure.sonic-mgmt |
Azure Pipelines successfully started running 1 pipeline(s). |
.format(voltage, psu_id, low_threshold, high_threshold)) | ||
|
||
break | ||
|
||
self.assert_expectations() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the self.assert_expectations() evaluate the 3 test run values? What happens for different combinations of the expected values? For example:
Test1: True
Test2: False
Test3: True
In this combination, does the test raise assert or passes?
Description of PR
Summary:
If
test_psu.py::TestPsuApi::test_power
fails onabs(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
Back port request
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