note this is a copy of AsyncApiTest, except the cancel stuff.