[nextest-runner] handle SIGINFO and SIGUSR1 to dump info to screen #1938
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part 1 of work to perform interactive queries.
With this change, if nextest receives either SIGINFO (where available) or SIGUSR1, it will print a list of all currently running tests with their states. The full test state machine is modeled in the event responses, along with possible sources of errors.
I tried making Ctrl-Break on Windows do the same thing, but unfortunately that doesn't quite work in practice. That's because Ctrl-Break is received by all processes connected to the console, not just by the equivalent of the "foreground process group". The printing out of info works, but running tests are immediately aborted as well. So remove this. (In interactive terminals we'll support an alternative -- pressing
i
-- which should work for most use cases on Windows.)There is also an undocumented environment variable
__NEXTEST_SIGQUIT_AS_INFO
which allowsSIGQUIT
(Ctrl-\
) to perform an info query. Quite useful for testing on Linux, where SIGINFO is sadly unavailable.Note: illumos does support SIGINFO, but that is blocked on an upstream issue: tokio-rs/tokio#6995