Notes on unit testing threads/sockets