Closed stefanseefeld closed 2 years ago
I just had a realization: The pytest-forked
code runs the actual test in a sub-process, but not the fixtures, correct ?
In my code the python-wrapped C++ application that is being tested is created and destroyed within fixtures, and I have strong suspicions that the crash actually happens in the teardown phase.
Assuming all of the above is true, how hard is it to run fixtures (at least all the ones that run per test rather than per session) within the forked process as well ?
That makes sense, but we try to run the entire setup/call/teardown in a subprocess:
Not sure how that plays with the fixture cache though.
...and I have yet to be able to build a minimal test case where a segfault in either setup, test, or teardown results in an error similar to what I reported earlier.
I have been able to trace this back to an incorrectly written signal handler in my own code. Sorry for the noise !
@stefanseefeld thanks for the followup
I'm observing the
pytest
process itself seemingly breaking as a result of a segmentation fault observed in a test. Here is the relevant part of the log:Any idea how this might happen ? Is this a pytest bug ?