Make TestHostConnection more robust