Modified test to sleep while waiting for currently executing tasks to complete.