Update connection test to handle failure better