-
Notifications
You must be signed in to change notification settings - Fork 1.2k
✨ Add tests in controller that use source.Channel #1373
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
✨ Add tests in controller that use source.Channel #1373
Conversation
Hi @varshaprasad96. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
9c8b6ba
to
70b92a8
Compare
/ok-to-test |
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 for taking the time for this!
|
||
ins := &source.Channel{Source: ch} | ||
ins.DestBufferSize = 1 | ||
Expect(inject.StopChannelInto(ctx.Done(), ins)).To(BeTrue()) |
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.
We just deprecated the injection, lets not add more code that uses it
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.
|
||
errChan := make(chan error) | ||
|
||
go func() { |
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.
Same comment re extra routine
|
||
errChan := make(chan error) | ||
|
||
go func() { |
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.
We can simplify this by not starting in a goroutine that writes into a channel and then waiting for the channel and instead just start in the main goroutine or not?
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 is blocking. Starting in main routine is causing the test to time out.
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 know its blocking, my point was that its needlessly complicated to start it in a distinct goroutine.
errChan := make(chan error)
go func(){
errChan <- someFunc()
}()
e := <-errChan
Is definitely semantically equivalent to
e := someFunc()
The test here works fine for me when changing it like described above and does not time out.
70b92a8
to
aa45ffa
Compare
is passed Added tests to verify the controller implementation when `source.Channel` is passed. Signed-off-by: varshaprasad96 <[email protected]>
aa45ffa
to
6c8bd4c
Compare
/retest |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, varshaprasad96 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 |
The additional tests verify controller implementation when
source.Channel
is passed.Fixes #1368
Will also be helpful for discussing #1346