Unit test node.fork_publish_inactive has a race condition.
It is not guaranteed that the election will remain in the AEC long enough to access it with this line:
auto election = node.active.election (send1->qualified_root ());
The test fails every time, by adding a 5 seconds delay, just before accessing the election:
system.poll (5s);
auto election = node.active.election (send1->qualified_root ());