We have a mechanic in Polars to install a timeout in a second thread which when triggered exits the process as hanging. We need this because for some bugs the entire process can hang in a Rust function.
This thus calls exit(1) directly, without invoking Python exceptions or sys.exit or anything of the sort. We have no alternative to this, we are unable to return to Python.
I'd like it if pytest-xdist would check the exit code of workers, and if it exited with a non-zero exit code it is treated as a crash, restarting said worker or if no further restarts are allowed, failing that test.