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

Deflake services e2e #18532

Merged
merged 2 commits into from
Dec 11, 2015
Merged

Deflake services e2e #18532

merged 2 commits into from
Dec 11, 2015

Conversation

thockin
Copy link
Member

@thockin thockin commented Dec 10, 2015

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

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.
@k8s-github-robot
Copy link

Labelling this PR as size/S

@k8s-github-robot k8s-github-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 10, 2015
@k8s-bot
Copy link

k8s-bot commented Dec 10, 2015

GCE e2e build/test failed for commit ed1f2d7.

@k8s-bot
Copy link

k8s-bot commented Dec 10, 2015

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
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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.

@k8s-github-robot
Copy link

Labelling this PR as size/M

@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 11, 2015
@k8s-bot
Copy link

k8s-bot commented Dec 11, 2015

GCE e2e test build/test passed for commit ad22d00.

@wojtek-t
Copy link
Member

LGTM

@wojtek-t wojtek-t added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 11, 2015
@wojtek-t
Copy link
Member

Manually merging - to see if that really helps as soon as possible.

wojtek-t added a commit that referenced this pull request Dec 11, 2015
@wojtek-t wojtek-t merged commit 6e29e84 into kubernetes:master Dec 11, 2015
@thockin thockin deleted the deflake-svcs-e2e branch December 14, 2015 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants