Fix test failing intermittently.

This test was failing for me in docker. It was panicing because WriteString
wasn't connected to an actual server. Not sure if this is the correct fix, but
it solve the errors.