adding unit test for early return when worker has been cancelled