Skip to content
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

Scheduler service_affinity_test.go should use a fake SharedInformerFactory and call New #84943

liu-cong opened this issue Nov 7, 2019 · 2 comments


Copy link

@liu-cong liu-cong commented Nov 7, 2019

What would you like to be added:
The test should call service_affinity.New directly instead of creating predicates and priorities. This requires a fake SharedInformerFactory to be used as an option for the framework. The fake SharedInformerFactory should return a fake service lister that returns the services in test.

There might be other cases like this too. We should fix them.

predicate, precompute := predicates.NewServiceAffinityPredicate(snapshot.NodeInfos(), snapshot.Pods(), fakelisters.ServiceLister(, test.labels)

Why is this needed:
The initialization code path is not properly tested without this.

/sig scheduling


This comment has been minimized.

Copy link

@ahg-g ahg-g commented Nov 8, 2019



This comment has been minimized.

Copy link

@mrkm4ntr mrkm4ntr commented Nov 8, 2019


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can’t perform that action at this time.