Author: pmouawad
Date: Mon Mar 14 20:10:09 2016
New Revision: 1734992

URL: http://svn.apache.org/viewvc?rev=1734992&view=rev
Log:
Bug 59133 - Regression in custom Thread Group in nightly build before 3.0 (6 
march 2016)
#resolve #164
https://github.com/apache/jmeter/pull/164
Bugzilla Id: 59133

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java?rev=1734992&r1=1734991&r2=1734992&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java Mon Mar 
14 20:10:09 2016
@@ -235,39 +235,40 @@ public class JMeterThread implements Run
 
         try {
             iterationListener = initRun(threadContext);
-            Sampler sam = threadGroupLoopController.next();
-            while (running && sam != null) {
-                processSampler(sam, null, threadContext);
-                threadContext.cleanAfterSample();
-                
-                // restart of the next loop 
-                // - was request through threadContext
-                // - or the last sample failed AND the onErrorStartNextLoop 
option is enabled
-                if(threadContext.isRestartNextLoop()
-                        || (onErrorStartNextLoop
-                                && 
!TRUE.equals(threadContext.getVariables().get(LAST_SAMPLE_OK)))) 
-                {
+            while (running) {
+                Sampler sam = threadGroupLoopController.next();
+                while (running && sam != null) {
+                    processSampler(sam, null, threadContext);
+                    threadContext.cleanAfterSample();
                     
-                    if(log.isDebugEnabled()) {
-                        if(onErrorStartNextLoop
-                                && !threadContext.isRestartNextLoop()) {
-                            log.debug("StartNextLoop option is on, Last sample 
failed, starting next loop");
+                    // restart of the next loop 
+                    // - was requested through threadContext
+                    // - or the last sample failed AND the 
onErrorStartNextLoop option is enabled
+                    if(threadContext.isRestartNextLoop()
+                            || (onErrorStartNextLoop
+                                    && 
!TRUE.equals(threadContext.getVariables().get(LAST_SAMPLE_OK)))) 
+                    {
+                        if(log.isDebugEnabled()) {
+                            if(onErrorStartNextLoop
+                                    && !threadContext.isRestartNextLoop()) {
+                                log.debug("StartNextLoop option is on, Last 
sample failed, starting next loop");
+                            }
                         }
+                        
+                        triggerEndOfLoopOnParentControllers(sam, 
threadContext);
+                        sam = null;
+                        threadContext.getVariables().put(LAST_SAMPLE_OK, TRUE);
+                        threadContext.setRestartNextLoop(false);
+                    }
+                    else {
+                        sam = threadGroupLoopController.next();
                     }
-                    
-                    triggerEndOfLoopOnParentControllers(sam, threadContext);
-                    threadContext.getVariables().put(LAST_SAMPLE_OK, TRUE);
-                    threadContext.setRestartNextLoop(false);
-                    sam = null;
                 }
                 
-                if (sam == null && threadGroupLoopController.isDone()) {
+                if (threadGroupLoopController.isDone()) {
                     running = false;
                     log.info("Thread is done: " + threadName);
                 }
-                else {
-                    sam = threadGroupLoopController.next();
-                }
             }
         }
         // Might be found by contoller.next()

Modified: jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1734992&r1=1734991&r2=1734992&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Mar 14 20:10:09 2016
@@ -402,6 +402,7 @@ Summary
     <li><bug>59055</bug>JMeter report generator : When generation is not 
launched from jmeter/bin folder report-template is not found</li>
     <li><bug>58986</bug>Report/Dashboard reuses the same output directory</li>
     <li><bug>59096</bug>Search Feature : Case insensitive search is not really 
case insensitive</li>
+    <li><bug>59133</bug>Regression in custom Thread Group in nightly build 
before 3.0 (6 march 2016). Contributed by Ubik Load Pack (support at 
ubikloadpack.com)</li>
 </ul>
 
  <!--  =================== Thanks =================== -->


Reply via email to