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

Updating EndpointSlice e2e tests to be less flaky and easier to debug #93402

Merged
merged 1 commit into from
Jul 25, 2020

Conversation

robscott
Copy link
Member

@robscott robscott commented Jul 23, 2020

What type of PR is this?
/kind cleanup
/kind failing-test

What this PR does / why we need it:
This adjusts tests that were waiting for Pods to be ready to instead just wait for them to have IPs assigned to them. This relies on the associated publishNotReadyAddresses field on Services. Additionally this increases the the length of time we'll wait for EndpointSlices to be garbage collected from 12s to 18s. Finally, this adds additional logging to ExpectNoError calls so it's easier to understand where and why a test failed.

Which issue(s) this PR fixes:
I'm hoping this PR will fix #93374 and #92776, but all I can say for sure is that it "works on my cluster".

Special notes for your reviewer:
Although it seems backwards to even be testing for EndpointSlice garbage collection we need some kind of test coverage to make sure that the EndpointSlice controller does not conflict with the garbage collector. Maybe there's a better way to do that than have this long timeout here. It could potentially be more straightforward to just immediately delete both Endpoints and EndpointSlices when a Service is marked for deletion, but that could potentially be undesirable if there are long running finalizers in place.

Does this PR introduce a user-facing change?:

NONE

/cc @aojea @freehan @RobertKielty @hasheddan
/assign @liggitt

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 23, 2020
@robscott
Copy link
Member Author

robscott commented Jul 23, 2020

/sig networking
/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jul 23, 2020
@k8s-ci-robot
Copy link
Contributor

@robscott: The label(s) sig/test cannot be applied, because the repository doesn't have them

In response to this:

/sig test
/priority critical-urgent

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.

@k8s-ci-robot k8s-ci-robot added area/test sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 23, 2020
@robscott
Copy link
Member Author

/remove-kind feature
/kind failing-test

@k8s-ci-robot k8s-ci-robot added kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Jul 23, 2020
Comment on lines 131 to 132
// Expect Endpoints resource to not be deleted when Service is.
// TODO(robscott): Update this test when this bug is fixed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we expect that the Endpoints resource will not be deleted here wouldn't this test always fail?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, I don't understand the comment either, the code seems to check they are deleted

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Apparently I momentarily confused this part with another part that is waiting for an Endpoints related fix and thought I'd forgotten to add a TODO here. As it turns out the TODO already existed in the appropriate place: https://github.com/kubernetes/kubernetes/blob/master/test/e2e/network/endpointslice.go#L296-L297. That bug will actually be fixed with an open PR so I need to remember to connect those dots.

@robscott robscott force-pushed the endpointslice-test-fix branch from 3278b0d to 10be96b Compare July 24, 2020 04:07
@@ -143,7 +143,7 @@ var _ = SIGDescribe("EndpointSlice", func() {
}

// Expect EndpointSlice resource to be deleted when Service is.
if err := wait.PollImmediate(2*time.Second, 12*time.Second, func() (bool, error) {
if err := wait.PollImmediate(2*time.Second, 18*time.Second, func() (bool, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a surprisingly specific time... why not wait.ForeverTestTimeout (30 seconds)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow I think I'd thought the only reason it would take longer than this would be a legitimate failure, clearly that's not always the case. Also, I didn't know about wait.ForeverTestTimeout - I've updated all 4 instances of 12 second times to use that instead, thanks!

@robscott robscott force-pushed the endpointslice-test-fix branch from 10be96b to 3fea696 Compare July 24, 2020 17:30
This adjusts tests that were waiting for Pods to be ready to instead
just wait for them to have IPs assigned to them. This relies on the
associated publishNotReadyAddresses field on Services. Additionally this
increases the the length of time we'll wait for EndpointSlices to be garbage
collected from 12s to 30s. Finally, this adds additional logging to
ExpectNoError calls so it's easier to understand where and why a test
failed.
@robscott robscott force-pushed the endpointslice-test-fix branch from 3fea696 to 3e4745d Compare July 24, 2020 17:35
@liggitt
Copy link
Member

liggitt commented Jul 24, 2020

/lgtm
/approve
/milestone v1.19

@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jul 24, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 24, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, robscott

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 24, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@robscott
Copy link
Member Author

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@robscott
Copy link
Member Author

/retest

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

1 similar comment
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 17a2e5e into kubernetes:master Jul 25, 2020
@robscott robscott deleted the endpointslice-test-fix branch March 11, 2021 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. release-note-none Denotes a PR that doesn't merit a release note. sig/network Categorizes an issue or PR as relevant to SIG Network. sig/testing Categorizes an issue or PR as relevant to SIG Testing. 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.

[Flaky test] EndpointSlice should create Endpoints and EndpointSlices for Pods matching a Service
6 participants