@Test
  public void testRpcTimeout() throws IOException {
    RpcCall call = mock(RpcCall.class);
    // fake a RpcCall which is already timed out
    when(call.getDeadline()).thenReturn(EnvironmentEdgeManager.currentTime() - 10000);
    RpcServer.setCurrentCall(call);
    // make sure that the update operation does not throw timeout exception
    region.update(
      r -> r.put(new Put(Bytes.toBytes("row")).addColumn(CF1, QUALIFIER, Bytes.toBytes("value"))));
    assertSame(call, RpcServer.getCurrentCall().get());
  }
Make sure that we will not get rpc timeout when updating master region.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/TestMasterRegionRpcTimeout.java