@Override
  public void run() {
    try {
      LOG.info("Running Chaos Agent on : " + agentName);
      while (!this.isConnected()) {
        Thread.sleep(100);
      }
      this.getTasks();
      while (!stopChaosAgent.get()) {
        Thread.sleep(500);
      }
    } catch (InterruptedException e) {
      LOG.error("Error while running Chaos Agent", e);
    }

  }
Below function executes command with retries with given user. Uses LocalShell to execute a
command.
@param user user name, default none
@param cmd  Command to execute
@return A pair of Exit Code and Shell output
@throws IOException Exception while executing shell command
hbase-it/src/main/java/org/apache/hadoop/hbase/chaos/ChaosAgent.java