-
Notifications
You must be signed in to change notification settings - Fork 892
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
pkg/search/controllers_test: reduce the probability of flaky test cases by waiting for cache to sync #5936
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5936 +/- ##
=======================================
Coverage 48.10% 48.11%
=======================================
Files 663 663
Lines 54769 54769
=======================================
+ Hits 26349 26352 +3
+ Misses 26711 26709 -2
+ Partials 1709 1708 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There is indeed such a setting in the controller startup, and I think this should work: karmada/pkg/search/controller.go Line 136 in 471d850
|
I executed |
In terms of implementation, the WaitForCacheSync method should be called. There may be other problems with the ut failure. I feel that I can continue to push this pr and explore other problems. Hi @mohamedawnallah can you revise it according to the comments? |
Thanks, @zhzhuang-zju, for testing this 2000 times, twice! You're right. I’ve also tried this, and as mentioned in the PR description, the proposed changes reduce the likelihood of flaky test cases. Before, the tests were failing more frequently. It would be interesting to gather more empirical observations from the GitHub CI test failures as @XiShanYongYe-Chang pointed, if any. What are your thoughts? |
Currently, the What do you think, @XiShanYongYe-Chang? karmada/pkg/search/controller.go Lines 131 to 145 in 471d850
|
Apologies for the delayed response to the PR feedback. I've been quite busy recently, but I’ve now added comments addressing all the feedback. I’d love to hear your thoughts on them. 🙏 |
I don't quite understand why we need to add static time to wait. Events are blocked waiting, and as long as events can be fetched from the queue, processing is executed. So I understand that the changes now are sufficient. |
Sorry for not providing enough context! 🙏 I was referring to what happens if we use |
Oh! Thanks @mohamedawnallah
It's okay. As long as you have time, you can always contribute. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XiShanYongYe-Chang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind flake
What this PR does / why we need it:
This PR reduce the probability of flaky test cases by waiting for cache to sync. It seems fake client has some flaky issues with watch implementation that is different from real implementation as seen in kubernetes/kubernetes#87472 (comment)?
Which issue(s) this PR fixes:
Fixes #5926
Special notes for your reviewer:
Does this PR introduce a user-facing change?: