title: How do I add a sleep to my Retry TestNG method?
body: <p>I'm currently implementing a method of IRetryAnalyzer in combination with IAnnotationTransformer to perform a retry when my tests fail. I want to add a Thread.sleep() when the Retry occurs. Here's what I currently have:</p>
  
  <pre><code>public boolean retry(ITestResult result){
      if (retryCount &lt; maxRetryCount) {
          retryCount++;
          return true;
      }
      return false;
  }
  </code></pre>
  
  <p>When I add Thread.sleep() it requires that I add an thrown Exception for the Retry method:</p>
  
  <pre><code>public boolean retry(ITestResult result) throws Exception{
      if (retryCount &lt; maxRetryCount) {
          retryCount++;
          Thread.sleep(5);
          return true;
      }
      return false;
  }
  </code></pre>
  
  <p>However, the "Exception" gives me an error: "Overriden method does not throw java.lang.Exception". It seems like I can't actually add a Sleep to this retry despite how much I've tried. Does anyone know a work around?</p>