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
Remove unusued code and cleanup #520
Remove unusued code and cleanup #520
Conversation
} | ||
}() | ||
|
||
err := <-errs |
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 will block until the channel receives anything (which in most cases would be never cause err == nil
is normal?). Might be best to return this error channel as an extra param and then assign it to a var that can be checked in the AfterEach
once stop
has been closed, WDYT?
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.
good idea
@@ -59,7 +59,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { | |||
configShallowCopy := *c | |||
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { | |||
if configShallowCopy.Burst <= 0 { | |||
return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") | |||
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") |
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.
Is this not autogenerated code? Not sure this should be modified manually to fix linting errors
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.
right, it gets rewritten by make generate
ea56ae2
to
c8d1789
Compare
thanks for the improvements! for the StartTestManager we should to align with other actuators and ginkgo in follow ups. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre 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 |
if err := mgr.Start(stop); err != nil { | ||
t.Fatalf("error starting test manager: %v", err) | ||
errs <- err | ||
} |
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 might suggest you just put this on the channel anyway, doesn't matter if it's a nil value or not, we can check that where it's being read. That way we can also guarantee that we check the error, as currently the select might not catch it in time
So it would look like here:
errs <- mgr.Start(stop)
and then
defer func() {
if err := <-errChan; err != nil {
t.Fatalf("error starting test manager: %v", err)
}
}
3d4d701
to
5ef9594
Compare
defer close(stop) | ||
defer func() { | ||
select { | ||
case err := <-errChan: | ||
if err != nil { | ||
t.Fatalf("error starting test manager: %v", err) | ||
} | ||
default: | ||
} | ||
}() |
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 one needs updating to match the other one
defer close(stop) | |
defer func() { | |
select { | |
case err := <-errChan: | |
if err != nil { | |
t.Fatalf("error starting test manager: %v", err) | |
} | |
default: | |
} | |
}() | |
defer func() { | |
close(stop) | |
if err := <-errChan; err != nil { | |
t.Fatalf("error starting test manager: %v", err) | |
} | |
}() |
Once that last comment is fixed, I'm happy with this, @enxebre did you want the commits splitting to make the history cleaner? |
5ef9594
to
4c0c80c
Compare
@JoelSpeed @enxebre All changes are separated by commits |
/lgtm They seem sensible |
@alexander-demichev: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
This PR:
t.Fatalf
call from separate go routine