Skip to content

Make it possible to terminate pytest on deadlock after via the faulthandler timeout #13678

@ogrisel

Description

@ogrisel

What's the problem this feature will solve?

When debugging thread-safety problem, it can happen that the execution puts the Python interpreter into a deadlock state.

Enabling the faulthandler_timeout=30 ini option helps because it provides useful debugging information, however the pytest process is still stuck until the developer manually issues a KeyboardInterrupt via ctrl-c or waiting for the typical 1h+ deadline of the CI.

Describe the solution you'd like

Make it possible to tell the builtin faulthandler plugin to exit the pytest program itself without waiting any longer to avoid wasting CI resources.

The exit option is provided by default as a kwarg of faulthandler.dump_traceback_later. This is just a matter of exposing it in the builtin faulthandler plugin of pytest.

I have implemented this solution in a branch, and it seems to work as needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions