As web application programers we normally have only to deal with synchronous functions and single threads, because HTTP is a stateless protocol. But now, we have WebSockets, a technology to enable server push easily. This technology can be used to improve user experiences in some cases. For example, when searching is slow, we can show real and detailed progress of the searching to users with WebSockets. But wait! WebSocket brings us multithreaded programing and asynchronous functions. Why is this? And what are the pitfalls when testing Ruby functions that have threads. How can we avoid those pitfalls?