The test_inv_block from p2p_inv_download.py test case has a few flaws:
- The name does not reflect the content (it does not test any block inventory)
- The test relies on some event to occur within some timeout, which is unlikely to fail but is not guaranteed, and in case of failure makes it not obvious what the problem is
- It takes an absurd amount of time
This diff addresses all these points. It uses mocktime to both improve the robustness and make the test more easy to debug in case a failure occurs. The test duration is reduced by x2 on my machine (from ~120s to ~60s).