Skip to content

[mypyc] Don't swallow KeyboardInterrupt in test_run#7396

Merged
msullivan merged 2 commits intomasterfrom
fix-setup
Aug 27, 2019
Merged

[mypyc] Don't swallow KeyboardInterrupt in test_run#7396
msullivan merged 2 commits intomasterfrom
fix-setup

Conversation

@msullivan
Copy link
Copy Markdown
Collaborator

Currently we use distutil's run_setup function to wrap the
invocation of setup.py in test_run, which speeds things up a little
bit. Unfortunately run_setup swallows KeyboardInterrupt (and all
other failures), which prevents ctrl-c from terminating tests (the
tests will fail instead with -n0; with parallel testing, pytest will
die but it will take several seconds, I think while it waits for tests
to finish.)

Make a clone of run_setup that doesn't have these problems.

Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for improving our developer experience! Looks good, just a few minor comments.

if e.args == ("interrupted",):
raise KeyboardInterrupt

return False
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What if the exit code is 0? Should we return True in that case?

We had to fork it because the real run_setup swallows errors
and KeyboardInterrupt with no way to recover them (!).
The real version has some extra features that we removed since
we weren't using them.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Document the return value.

Currently we use distutil's `run_setup` function to wrap the
invocation of `setup.py` in test_run, which speeds things up a little
bit. Unfortunately `run_setup` swallows KeyboardInterrupt (and all
other failures), which prevents ctrl-c from terminating tests (the
tests will fail instead with -n0; with parallel testing, pytest will
die but it will take several seconds, I think while it waits for tests
to finish.)

Make a clone of run_setup that doesn't have these problems.
@msullivan msullivan merged commit cd525d2 into master Aug 27, 2019
@msullivan msullivan deleted the fix-setup branch August 27, 2019 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants