Test the cancel function.