Use driver.quit() method and it will be solved.
Explaination: The rootcasue of this error is that the socket is not closed properly. Websocket is still open so when we are executing this class step definition then it won't get the socket when you are closing it and will throw the error. So, just use driver.quit() method and error will be gone.