-
Notifications
You must be signed in to change notification settings - Fork 891
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: unit test controller #5810
pkg/search: unit test controller #5810
Conversation
8498073
to
b1d2ef9
Compare
b1d2ef9
to
c7c30a6
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5810 +/- ##
==========================================
+ Coverage 42.88% 43.72% +0.83%
==========================================
Files 656 656
Lines 55888 55925 +37
==========================================
+ Hits 23968 24452 +484
+ Misses 30369 29884 -485
- Partials 1551 1589 +38
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
In this commit, we unit test karmada search controller on creating new controller and handling the following events watched by the shared informer: `addCluster`, `updateCluster`, `deleteCluster`, `addResourceRegistry`, `updateResourceRegistry`, and `deleteResourceRegistry` making sure those handled and cached correctly to the indexer. Signed-off-by: Mohamed Awnallah <[email protected]>
c7c30a6
to
dc2eea8
Compare
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.
Thanks~
/lgtm
/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 |
Hi @mohamedawnallah, here is a UT ci failure, maybe related to your PR. https://github.com/karmada-io/karmada/actions/runs/11884685448/job/33113394945?pr=5814 FAIL pkg/search.TestDeleteClusterEventHandler (-1.00s)
FAIL pkg/search.TestDeleteClusterEventHandler/AddAllEventHandlers_TriggerDeleteClusterEvent_DeletedClusterAddedToWorkQueue (-1.00s)
=== Failed
=== FAIL: pkg/search (0.00s)
panic: test timed out after 10m0s
running tests:
TestDeleteClusterEventHandler (9m59s)
TestDeleteClusterEventHandler/AddAllEventHandlers_TriggerDeleteClusterEvent_DeletedClusterAddedToWorkQueue (9m59s)
goroutine 197 [running]:
testing.(*M).startAlarm.func1()
/opt/hostedtoolcache/go/1.22.9/x64/src/testing/testing.go:2366 +0x265
created by time.goFunc
/opt/hostedtoolcache/go/1.22.9/x64/src/time/sleep.go:177 +0x45
goroutine 1 [chan receive, 10 minutes]:
testing.(*T).Run(0xc0006951e0, {0x3e8af38, 0x1d}, 0x3f99900)
/opt/hostedtoolcache/go/1.22.9/x64/src/testing/testing.go:1750 +0x851
testing.runTests.func1(0xc0006951e0)
/opt/hostedtoolcache/go/1.22.9/x64/src/testing/testing.go:2161 +0x86
testing.tRunner(0xc0006951e0, 0xc00006db00)
/opt/hostedtoolcache/go/1.22.9/x64/src/testing/testing.go:1689 +0x21f
testing.runTests(0xc00013d8f0, {0x5cb6420, 0x8, 0x8}, {0xc00006dba8?, 0xc00006dbf0?, 0x5cd9280?})
/opt/hostedtoolcache/go/1.22.9/x64/src/testing/testing.go:2159 +0x8bf
testing.(*M).Run(0xc00065c320)
/opt/hostedtoolcache/go/1.22.9/x64/src/testing/testing.go:2027 +0xf18
main.main()
_testmain.go:95 +0x2e5
goroutine 150 [select]:
k8s.io/client-go/util/workqueue.(*delayingType[...]).waitingLoop(0x444f9e0)
/home/runner/work/karmada/karmada/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go:304 +0x4b9
created by k8s.io/client-go/util/workqueue.newDelayingQueue[...] in goroutine 149
/home/runner/work/karmada/karmada/vendor/k8s.io/client-go/util/workqueue/delaying_queue.go:141 +0x3c9 |
Hi @mohamedawnallah, can you help take a look of #5856 |
Description
In this commit, we unit test karmada search controller on creating new controller and handling the following events watched by the shared informer:
addCluster
,updateCluster
,deleteCluster
,addResourceRegistry
,updateResourceRegistry
, anddeleteResourceRegistry
making sure those handled and cached correctly to the indexer.What type of PR is this?
Which issue(s) this PR fixes:
Part of #5491
Does this PR introduce a user-facing change?: