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

Add signal handler for catching Ctrl-C on hack/e2e #51143

Merged
merged 1 commit into from
Aug 25, 2017

Conversation

oomichi
Copy link
Member

@oomichi oomichi commented Aug 22, 2017

What this PR does / why we need it:

When operating e2e test, hack/e2e.go process creates kubetest process.
To kill the kubetest process when stop e2e test with Ctrl-C, we need
to send the signal to the process because it also creates another
process and it needs to kill it.
This PR adds the signal handler on hack/e2e.go to kill the kubetest
process.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

fixes #43051

Special notes for your reviewer:

kubernetes/test-infra#4154 is the part of kubetest.

Release note:

NONE

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 22, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @oomichi. 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.

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/test-infra repository. I understand the commands that are listed here.

@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 Aug 22, 2017
@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels Aug 22, 2017
@BenTheElder
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 22, 2017
Copy link
Contributor

@fejta fejta left a comment

Choose a reason for hiding this comment

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

Very cool! One quick comment

hack/e2e.go Outdated
go func() {
sig := <-sig_channel
if err := c.Process.Signal(sig); err != nil {
log.Fatalf("err: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please make the error message easier for a human to understand the context, something like
Fatalf("could not send %s signal %s: %v", cmd, sig, err)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for your review.
Yeah, that should be. I will fix it soon.

@fejta
Copy link
Contributor

fejta commented Aug 23, 2017

/retest

@oomichi oomichi force-pushed the issue/43051 branch 2 times, most recently from f7e23a3 to 13fd2fd Compare August 23, 2017 21:01
@oomichi
Copy link
Member Author

oomichi commented Aug 23, 2017

/retest

When operating e2e test, hack/e2e.go process creates kubetest process.
To kill the kubetest process when stop e2e test with Ctrl-C, we need
to send the signal to the process because it also creates another
process and it needs to kill it.
This PR adds the signal handler on hack/e2e.go to kill the kubetest
process.

NOTE: kubernetes/test-infra#4154 is the part
      of kubetest.

solve kubernetes#43051
@dims
Copy link
Member

dims commented Aug 24, 2017

Go @oomichi !!!

@oomichi
Copy link
Member Author

oomichi commented Aug 24, 2017

@dims hehe, I am not sure which GO you mean. I am not good at GOlang yet anyways ;-)

@fejta
Copy link
Contributor

fejta commented Aug 25, 2017

/release-note-none
/unassign @jbeda
/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 25, 2017
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Aug 25, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fejta, oomichi

Associated issue: 43051

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2017
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 51038, 50063, 51257, 47171, 51143)

@k8s-github-robot k8s-github-robot merged commit acdf625 into kubernetes:master Aug 25, 2017
@oomichi oomichi deleted the issue/43051 branch February 10, 2018 00:32
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e tests can't be interrupted by Ctrl-C
7 participants