add the support for testing the random failure

can we avoid a new api?