[StreamServer API] connect to the WS in case of establish connection took more than waitingForConnection time; using fixed number for the waitingForConnection timeout instead of random; using sinon.stub in test case