This PR contains various improvements to zmq_test.py, including stopping it from hanging and causing travis builds to time out. Individual commits are:
- update zmq test to use correct config.ini file - follows #10331, which moved the config.ini file from /bitcoin/test/functional to /bitcoin/test. zmq_test.py was not updated to find the config file in the correct location. This isn’t a problem when running through test_runner.py, but would prevent zmq_test.py from being run directly.
- tidy up zmq_test.py - general code tidy-up. Cuts run time from ~12s to ~6s
- in zmq test, timeout if message not received - stops a race condition where we could try to receive a message on the zmq socket before it’s been sent
- destroy zmq context in zmq_tests.py - fixes an issue where the zmq contest would not be close properly at the end of the test, causing
sys.exit()to fail. This would cause travis builds to hang. See https://stackoverflow.com/questions/17140417/termination-of-python-script-while-using-zeromq-with-dead-server for more details. - timeout integration tests on travis after 20 minutes - causes travis builds to timeout individual tests if they run for more than 20 minutes. That means we’ll get logs from hung tests, rather than travis itself timing out after ~50 minutes (in which case we don’t get any useful diagnostics).
I need this for the next step of #10082, since this test was causing the next PR to hang in travis.
I believe this will also fix #10552 once that is rebased on top of this.