Test for cancelation handling.