Source:
<code>public void testWatchForCommitForRetryfailure() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); conf.setTimeDuration(OzoneConfigKeys.OZONE_CLIENT_WATCH_REQUEST_TIMEOUT, 100, TimeUnit.SECONDS); conf.setInt(OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_MAX_RETRIES_KEY, 10); startCluster(conf); XceiverClientManager clientManager = new XceiverClientManager(conf); ContainerWithPipeline container1 = storageContainerLocationClient .allocateContainer(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE, containerOwner); XceiverClientSpi xceiverClient = clientManager .acquireClient(container1.getPipeline()); Assert.assertEquals(1, xceiverClient.getRefcount()); Assert.assertEquals(container1.getPipeline(), xceiverClient.getPipeline()); Pipeline pipeline = xceiverClient.getPipeline(); XceiverClientReply reply = xceiverClient.sendCommandAsync( ContainerTestHelper.getCreateContainerRequest( container1.getContainerInfo().getContainerID(), xceiverClient.getPipeline())); reply.getResponse().get(); long index = reply.getLogIndex(); cluster.shutdownHddsDatanode(pipeline.getNodes().get(0)); cluster.shutdownHddsDatanode(pipeline.getNodes().get(1)); try { xceiverClient <START> .watchForCommit(index + new Random().nextInt(100) + 10, 20000); <END> Assert.fail("expected exception not thrown"); } catch (Exception e) { Assert.assertTrue(e instanceof ExecutionException); Assert.assertFalse(HddsClientUtils .checkForException(e) instanceof TimeoutException); } clientManager.releaseClient(xceiverClient, false); shutdown(); }</code><technical_language>instead of a Random increment, increment a fixed number everytime - 100 110? This applies other modified test cases well</technical_language>

Target:
public void testWatchForCommitForRetryfailure() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); conf.setTimeDuration(OzoneConfigKeys.OZONE_CLIENT_WATCH_REQUEST_TIMEOUT, 100, TimeUnit.SECONDS); conf.setInt(OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_MAX_RETRIES_KEY, 20); startCluster(conf); XceiverClientManager clientManager = new XceiverClientManager(conf); ContainerWithPipeline container1 = storageContainerLocationClient .allocateContainer(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE, containerOwner); XceiverClientSpi xceiverClient = clientManager .acquireClient(container1.getPipeline()); Assert.assertEquals(1, xceiverClient.getRefcount()); Assert.assertEquals(container1.getPipeline(), xceiverClient.getPipeline()); Pipeline pipeline = xceiverClient.getPipeline(); XceiverClientReply reply = xceiverClient.sendCommandAsync( ContainerTestHelper.getCreateContainerRequest( container1.getContainerInfo().getContainerID(), xceiverClient.getPipeline())); reply.getResponse().get(); long index = reply.getLogIndex(); cluster.shutdownHddsDatanode(pipeline.getNodes().get(0)); cluster.shutdownHddsDatanode(pipeline.getNodes().get(1)); try { xceiverClient .watchForCommit(index + new Random().nextInt(100) + 10, 20000); Assert.fail("expected exception not thrown"); } catch (Exception e) { Assert.assertTrue(e instanceof ExecutionException); Assert.assertFalse(HddsClientUtils .checkForException(e) instanceof TimeoutException); } clientManager.releaseClient(xceiverClient, false); shutdown(); }