Is this to wait for the thread to get started? It would be better to use a condition variable or semaphore instead of sleeping, because this is a long time to sleep in a unit test.