title: JMeter Scripts - Stop All Thread Groups (Entire Test) based on a condition
body: <p>I have a JMeter script with multiple thread groups which are running concurrently. In one thread group <code>PostProcessor</code>, I would like to check for a condition and stop <strong>ALL</strong> thread groups, and exit. Basically, I want to stop the entire test.</p>
  <pre><code>if (Integer.valueOf(prev.getResponseCode()) &gt;= 400) {
      // Stop the entire test in the next line.   
  }
  </code></pre>
  <p>How can I stop all thread groups at once, in a JMeter Script?</p>
  <p>Please see:</p>
  <ul>
  <li>My JMeter version: 5.3</li>
  <li>Groovy version: 3.0.3</li>
  </ul>