-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Make interrupting Pkg.test
more graceful
#2933
Make interrupting Pkg.test
more graceful
#2933
Conversation
I think this is a definite UX improvement, but would appreciate a second opinion |
+1, the current behavior is annoying and feels buggy as a user |
printpkgstyle(ctx.io, :Testing, "Tests interrupted. Exiting the test process\n", color = Base.error_color()) | ||
# Give some time for the child interrupt handler to print a stacktrace and exit, | ||
# then kill the process if still running | ||
if timedwait(() -> !process_running(p), 4) == :timed_out |
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.
Using timedwait
is often a general design problem, where you can usually use a Timer(4)
and wait(p)
instead though
printpkgstyle(ctx.io, :Testing, "Tests interrupted. Exiting the test process\n", color = Base.error_color()) | ||
# Give some time for the child interrupt handler to print a stacktrace and exit, | ||
# then kill the process if still running | ||
if timedwait(() -> !process_running(p), 4) == :timed_out |
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.
Using timedwait
is often a general design problem, where you can usually use a Timer(4)
and wait(p)
instead though
Currently
^C
-ing aPkg.test
can result in a big mess of mixed-up InterruptException stack traces from the child and parent process, and it's common for the child process to not actually get interrupted given there's only one shot for the^C
to get through to the child before the parent is interrupted and closes the signal forwarding, making it orphaned by the parent and continue to run tests while the parent process tries to go back to the repl, no matter how many times the user^C
's, requiring the user to find the orphaned process and kill it.This change tries to make the process more graceful:
pkg>
prompt once the child process is stopped, to avoid the prompt being printed-overThis PR
Closes #2922