jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1220300 - in /jmeter/trunk: src/core/org/apache/jmeter/threads/JMeterThread.java xdocs/changes.xml
Date Sat, 17 Dec 2011 23:08:56 GMT
Author: pmouawad
Date: Sat Dec 17 23:08:55 2011
New Revision: 1220300

URL: http://svn.apache.org/viewvc?rev=1220300&view=rev
Log:
Bug 52330 - With next-Loop-On-Error after error samples are not executed in next loop

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=1220300&r1=1220299&r2=1220300&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java Sat Dec 17 23:08:55
2011
@@ -268,46 +268,38 @@ public class JMeterThread implements Run
                 Sampler firstSampler = controller.next();
                 Sampler sam = firstSampler;
                 while (running && sam != null) {
-                    if (onErrorStartNextLoop) { // if the threadGroup option is to start
next loop when it fails
-                        // special case: TC as parent and last subsampler is not Ok
-                        if (!TRUE.equals(threadContext.getVariables().get(LAST_SAMPLE_OK))
&& sam instanceof TransactionSampler) {
-                            TransactionSampler ts = (TransactionSampler) sam;
-                            while (!ts.isTransactionDone()) { // go to last subsampler
-                                sam = controller.next();
-                                ts = (TransactionSampler) sam;
-                            }
-                            // process now for close transaction (not sampling)
-                            process_sampler(sam, null, threadContext);
-                        }
-                        
-                        // normal case: process sampler and get next
-                        if (TRUE.equals(threadContext.getVariables().get(LAST_SAMPLE_OK)))
{
-                            process_sampler(sam, null, threadContext);
-                            sam = controller.next();
-                        } else {
-                            // Find parent controllers of current sampler
-                            FindTestElementsUpToRootTraverser pathToRootTraverser = new FindTestElementsUpToRootTraverser(sam);
-                            testTree.traverse(pathToRootTraverser);
-                            List<Controller> controllersToReinit = pathToRootTraverser.getControllersToRoot();
-
-                            // Trigger end of loop condition on all parent controllers of
current sampler
-                            for (Iterator<Controller> iterator = controllersToReinit
-                                    .iterator(); iterator.hasNext();) {
-                                Controller parentController =  iterator.next();
-                                if(parentController instanceof ThreadGroup) {
-                                    ThreadGroup tg = (ThreadGroup) parentController;
-                                    tg.startNextLoop();
-                                } else {
-                                    parentController.triggerEndOfLoop();
-                                }
-                            }
-                            sam = null;
-                            threadContext.getVariables().put(LAST_SAMPLE_OK, TRUE);
-                        }
-                    } else {
-                        process_sampler(sam, null, threadContext);
-                        sam = controller.next();
-                    }
+                	process_sampler(sam, null, threadContext);
+                	if(onErrorStartNextLoop) {
+                		boolean lastSampleFailed = !TRUE.equals(threadContext.getVariables().get(LAST_SAMPLE_OK));
+                		if(lastSampleFailed) {
+	                		if(log.isDebugEnabled()) {
+	                    		log.debug("StartNextLoop option is on, Last sample failed, starting
next loop");
+	                    	}
+	                    	// Find parent controllers of current sampler
+	                        FindTestElementsUpToRootTraverser pathToRootTraverser = new FindTestElementsUpToRootTraverser(sam);
+	                        testTree.traverse(pathToRootTraverser);
+	                        List<Controller> controllersToReinit = pathToRootTraverser.getControllersToRoot();
+	
+	                        // Trigger end of loop condition on all parent controllers of current
sampler
+	                        for (Iterator<Controller> iterator = controllersToReinit
+	                                .iterator(); iterator.hasNext();) {
+	                            Controller parentController =  iterator.next();
+	                            if(parentController instanceof ThreadGroup) {
+	                                ThreadGroup tg = (ThreadGroup) parentController;
+	                                tg.startNextLoop();
+	                            } else {
+	                                parentController.triggerEndOfLoop();
+	                            }
+	                        }
+	                        sam = null;
+	                        threadContext.getVariables().put(LAST_SAMPLE_OK, TRUE);
+                		} else {
+                			sam = controller.next();
+                		}
+                	} 
+                	else {
+                		sam = controller.next();
+                	}
                 }
                 if (controller.isDone()) {
                     running = false;

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1220300&r1=1220299&r2=1220300&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Dec 17 23:08:55 2011
@@ -115,6 +115,7 @@ This behaviour can be changed with prope
 <li>Bug 51868 - A lot of exceptions in jmeter.log while using option "Start next loop"
for thread</li>
 <li>Bug 51866 - Counter under loop doesn't work properly if "Start next loop on error"
option set for thread group</li>
 <li>Bug 52296 - TransactionController + Children ThrouputController or InterleaveController
leads to ERROR sampleEnd called twice java.lang.Throwable: Invalid call sequence when TPC
does not run sample</li>
+<li>Bug 52330 - With next-Loop-On-Error after error samples are not executed in next
loop</li>
 </ul>
 
 <h3>Listeners</h3>



Mime
View raw message