-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
Conversation
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.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hshiina 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 |
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 Once the patch is verified, the new status will be reflected by the 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. |
/remove-kind failing-test |
/ok-to-test |
/triage accepted |
Delay: 10, | ||
ExitCode: 0, | ||
}), | ||
Lifecycle: &v1.Lifecycle{ | ||
PostStart: &v1.LifecycleHandler{ | ||
Exec: &v1.ExecAction{ | ||
Command: ExecCommand(prefixedName(PostStartPrefix, regular1), execCommand{ | ||
StartDelay: 1, |
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.
Just wondering if this test case should even check if poststart and regular container run together, especially if this requires artificially delaying poststart.
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 still worth checking this condition in RunTogether()
:
kubernetes/test/e2e_node/container_lifecycle_pod_construction.go
Lines 139 to 141 in 03ad8e5
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.
/assign |
#125282 will fix this problem. |
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 addsStartDelay
to the postStart hook so that the hook starts after the regular container.An example of the failure is here:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: