nrn icon indicating copy to clipboard operation
nrn copied to clipboard

pytest handling of C++ errors

Open olupton opened this issue 2 years ago • 7 comments

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.

olupton avatar Jun 20 '22 13:06 olupton

✔️ 2b7114291ce73770dad30f2b03ad9050c79a1d0e -> Azure artifacts URL

azure-pipelines[bot] avatar Jun 20 '22 22:06 azure-pipelines[bot]

✔️ 2c8211b5ba3c0f78f4621335a6df98ed8d84af3c -> Azure artifacts URL

azure-pipelines[bot] avatar Jun 21 '22 12:06 azure-pipelines[bot]

✔️ 6ca560ed21cf5fadae1eb31befd51b199dc1b034 -> Azure artifacts URL

azure-pipelines[bot] avatar Jun 21 '22 13:06 azure-pipelines[bot]

✔️ 0e3eb05dd18aa1640c8f46d2c6a592d947a3defa -> Azure artifacts URL

azure-pipelines[bot] avatar Jun 22 '22 16:06 azure-pipelines[bot]

We can refer to https://github.com/neuronsimulator/nrn/issues/1870 for why the RxD tests do not use --forked.

olupton avatar Jun 22 '22 16:06 olupton

✔️ dc51fcf7f6ccc6bb2febb56170a202bb7684d0a7 -> Azure artifacts URL

azure-pipelines[bot] avatar Jun 24 '22 09:06 azure-pipelines[bot]

✔️ f642460e8689f4f7907e2d4168e1d5814abc5f42 -> Azure artifacts URL

azure-pipelines[bot] avatar Jun 27 '22 10:06 azure-pipelines[bot]

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.

olupton avatar May 02 '23 13:05 olupton