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

node e2e: Add StartDelay to postStart hook #124854

Closed
wants to merge 1 commit into from

Conversation

hshiina
Copy link

@hshiina hshiina commented May 13, 2024

What type of PR is this?

/kind bug
/kind flake

What this PR does / why we need it:

Because of #124668, RunTogether() expects the first argument to start before the second argument. However, a regular container and a postStart hook start asynchronously. This fix adds StartDelay to the postStart hook so that the hook starts after the regular container.

An example of the failure is here:

{ failed [FAILED] couldn't find that PostStart-regular-1 ever started, got
0) 2024-05-08 09:07:01.942 +0000 UTC init-1 Starting
1) 2024-05-08 09:07:01.979 +0000 UTC init-1 Started
2) 2024-05-08 09:07:02.007 +0000 UTC init-1 Delaying
3) 2024-05-08 09:07:03.023 +0000 UTC init-1 Exiting
4) 2024-05-08 09:07:03.729 +0000 UTC PostStart-regular-1 Starting
5) 2024-05-08 09:07:03.735 +0000 UTC regular-1 Starting
6) 2024-05-08 09:07:03.754 +0000 UTC PostStart-regular-1 Started
7) 2024-05-08 09:07:03.755 +0000 UTC regular-1 Started
8) 2024-05-08 09:07:03.77 +0000 UTC regular-1 Delaying
9) 2024-05-08 09:07:03.771 +0000 UTC PostStart-regular-1 Delaying
10) 2024-05-08 09:07:04.789 +0000 UTC PostStart-regular-1 Exiting
11) 2024-05-08 09:07:13.862 +0000 UTC regular-1 Exiting
In [It] at: k8s.io/kubernetes/test/e2e_node/container_lifecycle_test.go:286 @ 05/08/24 09:07:17.158
}

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


Because of 6ecf0da, `RunTogether()` expects the first argument to
start before the second argument. However, a regular container and a
postStart hook start asynchronously. This fix adds `StartDelay` to the
postStart hook so that the hook starts after the regular container.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. kind/flake Categorizes issue or PR as related to a flaky test. labels May 13, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hshiina
Once this PR has been reviewed and has the lgtm label, please assign derekwaynecarr for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels May 13, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @hshiina. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 13, 2024
@hshiina
Copy link
Author

hshiina commented May 13, 2024

/remove-kind failing-test

@k8s-ci-robot k8s-ci-robot removed the kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. label May 13, 2024
@bart0sh bart0sh added this to Triage in SIG Node PR Triage May 14, 2024
@bart0sh
Copy link
Contributor

bart0sh commented May 15, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 15, 2024
@bart0sh
Copy link
Contributor

bart0sh commented May 15, 2024

/triage accepted
/priority important-soon
/cc @SergeyKanzhelev @kannon92
/cc

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 15, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 15, 2024
@bart0sh bart0sh moved this from Triage to Needs Reviewer in SIG Node PR Triage May 15, 2024
Delay: 10,
ExitCode: 0,
}),
Lifecycle: &v1.Lifecycle{
PostStart: &v1.LifecycleHandler{
Exec: &v1.ExecAction{
Command: ExecCommand(prefixedName(PostStartPrefix, regular1), execCommand{
StartDelay: 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just wondering if this test case should even check if poststart and regular container run together, especially if this requires artificially delaying poststart.

Copy link
Author

Choose a reason for hiding this comment

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

I think it's still worth checking this condition in RunTogether():

if rhsStart > lhsExit {
return fmt.Errorf("expected %s to start before exiting %s, got\n%v", rhs, lhs, o)
}

Although this doesn't look the primary purpose of this test case, I think it would be better to confirm that a regular container and a postStart hook run concurrently somewhere.

@haircommander
Copy link
Contributor

/assign

@hshiina
Copy link
Author

hshiina commented Jun 3, 2024

#125282 will fix this problem.

@hshiina hshiina closed this Jun 3, 2024
SIG Node CI/Test Board automation moved this from PRs - Needs Reviewer to Done Jun 3, 2024
@hshiina hshiina deleted the flake-poststart branch June 4, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/flake Categorizes issue or PR as related to a flaky test. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
SIG Node PR Triage
Needs Reviewer
Development

Successfully merging this pull request may close these issues.

None yet

4 participants