nrn
nrn copied to clipboard
pytest handling of C++ errors
This adds a test under the pynrn::basic_tests
CTest test that triggers an exit from C++ code.
If run by ctest -R pynrn::basic_tests -V
then we abort with no helpful output:
29: ============================= test session starts ==============================
29: platform linux -- Python 3.9.7, pytest-6.2.4, py-1.9.0, pluggy-0.13.0
29: rootdir: /gpfs/bbp.cscs.ch/home/olupton/nrn
29: plugins: cov-2.8.1
29: collected 55 items
29:
29: test/pynrn/test_a_neuronoptions.py . [ 1%]
29: test/pynrn/test_basic.py .............
1/1 Test #29: pynrn::basic_tests ...............***Failed 1.16 sec
This is a minimal reproducer for a hackathon task.
✔️ 2b7114291ce73770dad30f2b03ad9050c79a1d0e -> Azure artifacts URL
✔️ 2c8211b5ba3c0f78f4621335a6df98ed8d84af3c -> Azure artifacts URL
✔️ 6ca560ed21cf5fadae1eb31befd51b199dc1b034 -> Azure artifacts URL
✔️ 0e3eb05dd18aa1640c8f46d2c6a592d947a3defa -> Azure artifacts URL
We can refer to https://github.com/neuronsimulator/nrn/issues/1870 for why the RxD tests do not use --forked
.
✔️ dc51fcf7f6ccc6bb2febb56170a202bb7684d0a7 -> Azure artifacts URL
✔️ f642460e8689f4f7907e2d4168e1d5814abc5f42 -> Azure artifacts URL
This has been dormant for a long time. Surviving aborts by forking seems to be a problematic approach given that mixing threads and fork is challenging, to say the least.
We might like to revisit this using a full client-server model and pytest-xdist
at some point in the future.