Skip to content

Converted test to modern pytest

Created by: heplesser

Hi @med-ayssar,

[Sorry I first created the PR against the wrong branch]

Here is a pytest-ified version of the copy model test. This reveals a new and somewhat strange bug involving secondary event connections, i.e., the following:

In [2]: nest.synapse_models[66:]
Out[2]: 
('gap_junction',
 'gap_junction_lbl',
 'rate_connection_instantaneous',
 'rate_connection_instantaneous_lbl',
 'rate_connection_delayed',
 'rate_connection_delayed_lbl',
 'diffusion_connection',
 'diffusion_connection_lbl')

The problem arises from test_copy_synapse_models() and occurs only if one copies one of each pair and then the other, **with ResetKernel() in between, leading to a crash. A minimal reproducer is

In [2]: nest.CopyModel('gap_junction', 'foo')

In [3]: nest.ResetKernel()

In [4]: nest.CopyModel('gap_junction_lbl', 'foo_lbl')
Assertion failed: (not supports_syn_id( synid )), function add_syn_id, file event.h, line 1025.
[Hanss-MacBook-Pro:43261] *** Process received signal ***
[Hanss-MacBook-Pro:43261] Signal: Abort trap: 6 (6)
[Hanss-MacBook-Pro:43261] Signal code:  (0)
[Hanss-MacBook-Pro:43261] [ 0] 0   libsystem_platform.dylib            0x00007ff817a8fdfd _sigtramp + 29
[Hanss-MacBook-Pro:43261] [ 1] 0   python3.9                           0x0000000109ea8e70 PyUnicode_Type + 0
[Hanss-MacBook-Pro:43261] [ 2] 0   libsystem_c.dylib                   0x00007ff8179c5d24 abort + 123
[Hanss-MacBook-Pro:43261] [ 3] 0   libsystem_c.dylib                   0x00007ff8179c50cb err + 0
[Hanss-MacBook-Pro:43261] [ 4] 0   libnestkernel.master.dylib          0x000000010db9b803 _ZN4nest18DataSecondaryEventIdNS_16GapJunctionEventEE10add_syn_idEj.cold.1 + 35
...

I assume that some data structure is not properly reset when ResetKernel() does the finalize()-initialize() routine. Could you investigate further as part of this PR so that we get it right?

Merge request reports

Loading