fix(tests): Fix some places that race with an XHR response return
Merge pull request #1681 from jrgm/fix-xhr-remote-server

fix(tests): Fix some places that race with an XHR response return