[CMAKE] Run the leveldb tests serially
Summary:
This adds a facility to create a job pool with an arbitrary number of
concurrent jobs and assign it to a test suite. This is used to limit the
leveldb suite to a single job and make the tests run serially.
This adds about 20% to the leveldb tests duration on my machine, but
since they are only running as part of the check-all (or higher) global
target the impact is minor.
This is expected to prevent spurious leveldb failures like
https://build.bitcoinabc.org/viewLog.html?tab=buildLog&buildTypeId=BitcoinABC_Master_BitcoinAbcMasterCoverage&buildId=87936&guest=1
Depends on D7073.
Test Plan:
ninja all check-all ninja check-leveldb
Check it still works with make, even if the pool has no effect:
cmake .. make -j42 check-leveldb
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D6751