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

Interrupting tox with ^C^C leaves the test process running #1172

Closed
mgedmin opened this issue Feb 22, 2019 · 3 comments
Closed

Interrupting tox with ^C^C leaves the test process running #1172

mgedmin opened this issue Feb 22, 2019 · 3 comments

Comments

@mgedmin
Copy link
Contributor

@mgedmin mgedmin commented Feb 22, 2019

I ran tox, saw some errors, hit ^C to stop the test run. That didn't work so I hit ^C a couple of times more.\

Now I'm looking at

...................................................................................................................................................................................................................................................^CERROR: KEYBOARDINTERRUPT
Exception KeyboardInterrupt in <function remove at 0x7fa81be1e140> ignored
....^CERROR: keyboardinterrupt

[1m55s, exited with 2]
mg@platonas: ~/src/ivija [git:py3 *$=] $ ........

and while tox itself exited, the zope-testrunner process spawned by tox keeps running, spewing output to my terminal.

I'm on Ubuntu 18.10 with tox 3.7.0.

It would be nice if tox killed all the child processes (with SIGKILL) if the user presses ^C enough times, instead of leaving them running.

(Perhaps Unix process groups or terminal sessions could help? My Unix-fu is too weak to suggest a concrete solution.)

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Feb 22, 2019

We'll need to try to reproduce this, and then try to find a fix if possible.

@asottile
Copy link
Member

@asottile asottile commented Mar 8, 2019

Here's an easy reproduction:

import time

while True:
    try:
        time.sleep(1)
    except KeyboardInterrupt:
        print('haha you cannot kill me')
    print('.')
[tox]
skipsdist = true

[testenv]
commands = python t.py
$ tox
python create: /tmp/x/.tox/python
python run-test-pre: PYTHONHASHSEED='1672853450'
python runtests: commands[0] | python t.py
.
.
^Chaha you cannot kill me
.
ERROR: KEYBOARDINTERRUPT
.
.
.
.
^Chaha you cannot kill me
.
ERROR: keyboardinterrupt
$ .
.
.
.
.
.
.
pk.
ill tp.
.py
$ .
.
pkil.
l ^C
$ p.
grep t..
py
$ p.
grep -.
f t.py
5202
$ .
p.
kill -f.
 t.py

(also included: my struggle to type pkill -f t.py)

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Mar 11, 2019

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants