Add a test for WaitWithTimeout.