Skip to content

Add a new hook to inform user of current state on signal #12407

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

Open
yurivict opened this issue Jun 2, 2024 · 4 comments
Open

Add a new hook to inform user of current state on signal #12407

yurivict opened this issue Jun 2, 2024 · 4 comments
Labels
topic: reporting related to terminal output and user-facing messages and errors type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@yurivict
Copy link

yurivict commented Jun 2, 2024

What's the problem this feature will solve?

When some tests run for a very long time it is important to be able to know what are these tests. Currently it is difficult to find out.

Describe the solution you'd like

Pressing Ctrl-T should show the list of currently running tasks.

On FreeBSD we have a similar situation: the program that builds packages normally prints what packages were just finished or started, but when Ctrl-T is pressed it prints the list of currently running builds like this:

image

PyTest should do the same and on Ctrl-T should print the list of all currently running tests with their times, statuses, etc.

@RonnyPfannschmidt
Copy link
Member

PTest itself is not parallel/concurrent

However it's possibly a nice feature to have a hangup signal handler that triggers a hook which lets plugins inform the user of the current state

Pytest itself could return the current test In non-verbose mode

xdist could return the active test per gateway

@nicoddemus
Copy link
Member

As @RonnyPfannschmidt said, that feature would not make sense for pytest because it does not run tests in parallel (pytest-xdist and other plugins do, however).

I'm closing this for now, but another issue can be opened with a proposal for a new hook as outlined by @RonnyPfannschmidt. 👍

@nicoddemus nicoddemus closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
@yurivict
Copy link
Author

yurivict commented Jun 2, 2024

[...] but another issue can be opened with a proposal for a new hook [...]

I suggested a feature that would be potentially very useful.

How it is implemented and what hooks should be involved is an implementation detail.
I am not a PyTest developer and don't know what is the best way to implement this feature.
Developers should decide this, not me.

I don't know why this feature proposal was closed because this is a valid proposal for a needed, useful feature.
I don't know what hooks should be involved.

@nicoddemus
Copy link
Member

I didn't mean for you to open a new issue, sorry @yurivict.

I just think that we probably should work on a proposal for the hook in a separate issue, otherwise this tends to get "lost" in the midst of unrelated discussion.

But in retrospect I should not have closed this, as you mention, indeed this describes the feature, which is independent on how it will end up being actually implemented.

@nicoddemus nicoddemus reopened this Jun 2, 2024
@Zac-HD Zac-HD added type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature topic: reporting related to terminal output and user-facing messages and errors labels Jun 24, 2024
@Zac-HD Zac-HD changed the title Ctrl-T should show the list of currently running tests Add a new hook to inform user of current state on signal Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

4 participants