-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Deflake services e2e #18532
Deflake services e2e #18532
Conversation
Picking a nodePort needs to be more robust than "add one to an existing port and hope it works". Now we try all ports in the range if we have to.
Labelling this PR as size/S |
GCE e2e build/test failed for commit ed1f2d7. |
GCE e2e build/test failed for commit b88ea4257b68ff65186f1b2d77bd0308d8cf7e0f. |
By("changing service " + serviceName + ": update NodePort") | ||
nodePort2 := 0 | ||
for i := 1; i < ServiceNodePortRange.Size; i++ { | ||
offs1 := nodePort1 - ServiceNodePortRange.Base |
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 there a reason we can't just simplify this to
nodePort2 := ServiceNodePortRange.Base + (nodePort1 + i) % ServiceNodePortRange.Size
? The multiple offsets with subtraction and addition is a little confusing to follow.
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.
That doesn't give me the loop I want. I could just linear search from base
to base+limit if you think that would be easier to understand, but I
thought this was not too bad - get the offset of nodePort1, increment it
with wraparound, add it to base.
On Thu, Dec 10, 2015 at 4:20 PM, Jeff Grafton notifications@github.com
wrote:
In test/e2e/service.go
#18532 (comment)
:@@ -504,15 +504,22 @@ var _ = Describe("Services", func() {
By("hitting the pod through the service's LoadBalancer")
testLoadBalancerReachable(ingress1, 80)
By("changing service " + serviceName + " update NodePort")
nodePort2 := nodePort1 - 1
if !ServiceNodePortRange.Contains(nodePort2) {
//Check for (unlikely) assignment at bottom of range
nodePort2 = nodePort1 + 1
By("changing service " + serviceName + ": update NodePort")
nodePort2 := 0
for i := 1; i < ServiceNodePortRange.Size; i++ {
offs1 := nodePort1 - ServiceNodePortRange.Base
is there a reason we can't just simplify this to
nodePort2 := ServiceNodePortRange.Base + (nodePort1 + i) % ServiceNodePortRange.Size
? The multiple offsets with subtraction and addition is a little confusing
to follow.—
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/18532/files#r47307011.
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 think it's good enough (I also spent some time thinking why it is correct, but it seems to be).
Anyway - I'm going to manually merge this PR to see if that helps.
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.
If we decide that it's too complicated, we can fix that in a follow-up PR, I guess.
b88ea42
to
ad22d00
Compare
Labelling this PR as size/M |
GCE e2e test build/test passed for commit ad22d00. |
LGTM |
Manually merging - to see if that really helps as soon as possible. |
Picking a nodePort needs to be more robust than "add one to an existing port
and hope it works". Now we try all ports in the range if we have to.
Another tilt at #13818
@wojtek-t @ixdy