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