Skip to content

Deflake scheduler PostBind integration test#93661

Merged
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
Huang-Wei:flake-postbind
Aug 4, 2020
Merged

Deflake scheduler PostBind integration test#93661
k8s-ci-robot merged 1 commit into
kubernetes:masterfrom
Huang-Wei:flake-postbind

Conversation

@Huang-Wei

Copy link
Copy Markdown
Member

What type of PR is this?

/kind flake
/sig scheduling

What this PR does / why we need it:

For a successful scheduling, PostBind() is for sure called after Bind(). However, when the test detects the pod is assigned ".spec.nodeName" right after Bind() (before PostBind()), and process to check the postFilter counter, the test may flake.

This PR tries to fix this flake by waiting for PostBind() to complete. Additionally, it also wraps the scheduler initialization logic into the sub-test, to make each sub-test independent.

Which issue(s) this PR fixes:

Fixes #93659

Special notes for your reviewer:

The flake doesn't seem to block 1.19 release, so I think it can be merged to 1.20.

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/flake Categorizes issue or PR as related to a flaky test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 3, 2020
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Huang-Wei

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details 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 Aug 3, 2020
@Huang-Wei

Copy link
Copy Markdown
Member Author

diff -w would get a better diff for review.

/assign @ahg-g
/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. 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. labels Aug 3, 2020
@Huang-Wei

Copy link
Copy Markdown
Member Author

/retest

case <-time.After(time.Second * 15):
t.Errorf("pluginInvokeEventChan timed out")
}
if postBindPlugin.numPostBindCalled == 0 {

@soulxu soulxu Aug 4, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Emm...this check should be useless anymore? since if postBindPlugin is called, the pluginInvokeEventChan will return, if the postBindPlugin isn't called, the timeout will return.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

if the postBindPlugin isn't called, the timeout will return.

t.Errorf won't return - the logic proceeds to L1344.

@soulxu soulxu Aug 4, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if the postBindPlugin isn't called, the timeout will return.

t.Errorf won't return - the logic proceeds to L1344.

Yea, I mean only the t.Errorf at line 1342 is enough, line 1342 already ensure the plugin isn't called. so the line 1344 to 1346 can be removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see your point. Although the root cause of L1342 and L1344 ~ L1346 is the same, but their symptoms are different, so IMO keeping L1344 ~ L1346 as is can make the semantics more explicit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

got it, thanks

@alculquicondor alculquicondor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 4, 2020
@ahg-g

ahg-g commented Aug 4, 2020

Copy link
Copy Markdown
Member

/milestone v1.19

I think we should still include it in 1.19.

@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Aug 4, 2020
@k8s-ci-robot
k8s-ci-robot merged commit c73fef5 into kubernetes:master Aug 4, 2020
@Huang-Wei
Huang-Wei deleted the flake-postbind branch August 4, 2020 17:20
mhan8796 pushed a commit to mhan8796/kubernetes that referenced this pull request Jun 26, 2026
Deflake scheduler PostBind integration test
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/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. 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] scheduler integration test TestPostBindPlugin

5 participants