Fix unstable unit tests (state change handler wasn't invoked)#8
Merged
zjswhhh merged 4 commits intosonic-net:masterfrom Dec 1, 2021
Merged
Fix unstable unit tests (state change handler wasn't invoked)#8zjswhhh merged 4 commits intosonic-net:masterfrom
zjswhhh merged 4 commits intosonic-net:masterfrom
Conversation
reset mIoService before run_one() Revert "reset mIoService before run_one()" This reverts commit 68c51f5c5d1901dc23017712376d441bc6e6fede.
update unit test MuxStandbyLinkProberUnknownCliSwitchover Revert "update unit test MuxStandbyLinkProberUnknownCliSwitchover" This reverts commit 794387ae561706cfe279a677e24f32d247f6195d. update unit test MuxStandbyLinkProberUnknownCliSwitchover Revert "update unit test MuxStandbyLinkProberUnknownCliSwitchover" This reverts commit 71ceab7b248af706882124c93d7bb0135a2397a2.
yxieca
approved these changes
Dec 1, 2021
yxieca
approved these changes
Dec 1, 2021
zjswhhh
added a commit
to zjswhhh/sonic-linkmgrd
that referenced
this pull request
Dec 15, 2021
…net#8) Description of PR Summary: Fixes # (issue) Fix unstable unit tests. People observed that linkmgrd unit tests appeared to be flaky, and kept failing PR checks. After checking the build logs, I found that in most of the failures, the state change handler didn't seem to be invoked: Linkmgrd's composite state remained as it was before the state change was post. This PR updates code to invoke io_service::reset(), sets the io_service to no longer be in a stopped state, allowing subsequent calls to run_one() to invoke handlers. (When io_service is stopped, any call to run_one() will return immediately without invoking any handler. ) Signed-off-by: Jing Zhang zhangjing@microsoft.com Type of change Bug fix Approach What is the motivation for this PR? Stabilize linkmgrd unit tests. How did you do it? Reset stopped io_service before calling to run_one(), to guarantee state change handlers are invoked as expected. How did you verify/test it? Tested building locally. This issue is hard to reproduce, the current build failure data is 2.98% (56/1877 in last 30 days). We should expect to see improvement after this change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes # (issue)
Fix unstable unit tests.
People observed that linkmgrd unit tests appeared to be flaky, and kept failing PR checks. After checking the build logs, I found that in most of the failures, the state change handler didn't seem to be invoked: Linkmgrd's composite state remained as it was before the state change was post.
This PR updates code to invoke io_service::reset(), sets the io_service to no longer be in a stopped state, allowing subsequent calls to run_one() to invoke handlers. (When io_service is stopped, any call to run_one() will return immediately without invoking any handler. )
Signed-off-by: Jing Zhang zhangjing@microsoft.com
Type of change
Back port request
Approach
What is the motivation for this PR?
Stabilize linkmgrd unit tests.
How did you do it?
Reset stopped io_service before calling to run_one(), to guarantee state change handlers are invoked as expected.
How did you verify/test it?
Tested building locally.
This issue is hard to reproduce, the current build failure data is 48 times in the last 30 days. We should expect to see improvement after this change.