[test][minor] Ensure that the socket is actually a socket