-
Notifications
You must be signed in to change notification settings - Fork 650
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
Fix DBConfig not initialize issue in pfcwd #2238
Conversation
pfcwd/main.py
Outdated
def initialize_db_config(): | ||
# Initialize db config here for UT coverage | ||
load_db_config() | ||
return |
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.
Our code coverage requirement is 80%, so need return here to pass coverage check.
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.
Prefer keep code cleaner, and fix the test infra.
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.
I am okay to override coverage check force merge and suppress coverage checker in of this PR as long as there is an issue tracking the coverage issue.
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.
Will improve code and try fix test infra later.
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.
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.
This seems a known issue in click: pallets/click#267
Will try use subprocess.check_output to cover code in cli().
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.
I try different solution but all failed, so change code coverage threshold to 50%.
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.
Revert the code coverage threshold change for force merge.
@qiluo-msft , @SuvarnaMeenakshi - does this one need to be in 202205 branch? |
Not required in 202205 because the change that caused this issue #2183 is not there in 202205 branch |
Just clarify, we ran into this issue with 202205 image. We filed sonic-net/sonic-buildimage#12062 to track. |
This PR need cherry pick to 202205 branch to fix sonic-net/sonic-buildimage#12062 |
@gechiang check if this can cherry picked into 20205 branch |
#### What I did Fix pfcwd connect DB with exception issue: sonic-net/sonic-buildimage#11269 pfcwd implicit depends on InterfaceAliasConverter() to initialize DB config, however following PR change InterfaceAliasConverter() behavior to lazy initialize, then pfcwd failed when try connect to DB without initialize DB config: sonic-net#2183 #### How I did it Load DB config in pfcwd. #### How to verify it Pass all UT.
#### What I did Fix pfcwd connect DB with exception issue: sonic-net/sonic-buildimage#11269 pfcwd implicit depends on InterfaceAliasConverter() to initialize DB config, however following PR change InterfaceAliasConverter() behavior to lazy initialize, then pfcwd failed when try connect to DB without initialize DB config: #2183 #### How I did it Load DB config in pfcwd. #### How to verify it Pass all UT. Co-authored-by: Hua Liu <[email protected]>
I removed the label request for 20205 branch because I manually created a PR to pick up this same change in 202205 here: |
What I did
Fix pfcwd connect DB with exception issue: sonic-net/sonic-buildimage#11269
pfcwd implicit depends on InterfaceAliasConverter() to initialize DB config, however following PR change InterfaceAliasConverter() behavior to lazy initialize, then pfcwd failed when try connect to DB without initialize DB config:
#2183
How I did it
Load DB config in pfcwd.
How to verify it
Pass all UT.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)