add the support for testing the random failure

That's what **taskStopChan** is.