Fix the processor_tests spurious segmentation fault
Summary:
Most of the tests create blocks and involve the validation queue. When
the test fixture is destructed at the end of a test, the queue might not
be empty and attempt to access destructed content, leading to the
spurious segfault. This diff fixes the issue by force-waiting for the
queue to clear on fixture destruction.
Test Plan:
With both gcc and clang, but no debug:
ninja check for i in {1..1000}; do ./src/avalanche/test/test-avalanche -t processor_tests || exit 1; done
Before this patch: about 3% failure rate. After this patch, no issue
during the 1000x loop with both compilers.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D9687