tests/artifactshare: safer cleanup_on_sigterm use
Use the documented path to pytest_cov.embed.cleanup_on_sigterm()
,
to avoid crashing on some versions.
It turns out that pytest_cov v2.6.1 on my machine doesn't like the way that we were accessing cleanup_on_sigterm(). Access it in such a way that we will either get the function or an ImportError, as per the documentation.
Remove a couple of cases where it's possible to make the main test process hang, waiting for something to appear on a queue.
Make it clearer what is available to the server process by splitting it out into a non-member function.
Raise a friendlier exception, earlier, if there was a problem starting the server process.
Edited by Angelos Evripiotis