dinamic timeout of websocket test
some refactoring