Bug 52618 - The first CSV Data Set config returns <EOF> for first iteration when called by Module Controller
Summary: The first CSV Data Set config returns <EOF> for first iteration when called b...
Status: RESOLVED DUPLICATE of bug 56160
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.6
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-07 10:33 UTC by alexander.hertlein
Modified: 2014-12-06 15:43 UTC (History)
3 users (show)



Attachments
Testplan + CSV (1.87 KB, application/rar)
2012-02-07 15:35 UTC, alexander.hertlein
Details
Testplan without Transaction Controllers + CSV (3.55 KB, application/rar)
2012-02-08 09:01 UTC, alexander.hertlein
Details
testplan without Module Controllers + CSV (1.63 KB, application/rar)
2012-02-09 12:35 UTC, alexander.hertlein
Details
Possible Patch to issue (823 bytes, patch)
2012-02-10 14:22 UTC, Philippe Mouawad
Details | Diff
Test Plan showing issue and using Debug Sampler (8.19 KB, application/xml)
2012-02-10 14:23 UTC, Philippe Mouawad
Details
Possible Patch to issue v2 (960 bytes, patch)
2012-02-12 22:29 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description alexander.hertlein 2012-02-07 10:33:40 UTC
Environment:
-Jmeter 2.6
-Windows XP SP3

I have the following setup in a jmeter script (simplified):

+Thread Group

  +Simple Controller 1 <DEACTIVATED>
    -HTTP Request HTTPClient (fed by the CSV data)
 
  +WHILE Controller 1(Condition= if <EOF> isn't reached) <DEACTIVATED>
    -CSV Data Set Config (using csv1)
    -Module Controller calling: Simple Controller 1

  +WHILE Controller 2(Condition= if <EOF> isn't reached) <DEACTIVATED>
    -CSV Data Set Config (using csv2)
    -Module Controller calling: Simple Controller 1

  +WHILE Controller 3(Condition= if <EOF> isn't reached) <DEACTIVATED>
    -CSV Data Set Config (using csv3)
    -Module Controller calling: Simple Controller 1

  +IF Controller 1
    +Transaction Controller 1
      -Module Controller calling: WHILE Controller 1

  +IF Controller 2
    +Transaction Controller 2
      -Module Controller calling: WHILE Controller 2
.
.
.

When running this script and the condition of the "IF Controller 1" is met the "WHILE Controller 1" is never entered as the first Dataset the CSV Data Set Config returns is "<EOF>".
If condition of "IF Controller 2" is met the while loop is executed as normal.

Additional information:
-this script is created with jmeter version 2.1 and then updated to 2.2 updated to to 2.4 and now to 2.6

Reproducibility:
-this isn't reproducible with the previous versions
-when building a script with 2.6 from the scratch using this modular approach it is also not reproducible
-we use many scripts using this approach and all show the same behaviour. The first CSV Data Set Config if called by Module Controllers always returns "<EOF>" as first data
-we also tried and created a script using the same csv data and while controllers but not using module controller. Here the Bug was also not reproducible 

So our assumption is that it is related to module controllers calling the csv data set config
Comment 1 Sebb 2012-02-07 11:56:57 UTC
(In reply to comment #0)

...

> -this script is created with jmeter version 2.1 and then updated to 2.2 updated
> to to 2.4 and now to 2.6

...

> -when building a script with 2.6 from the scratch using this modular approach
> it is also not reproducible

...

> So our assumption is that it is related to module controllers calling the csv
> data set config

In which case it looks more like there is an issued with the auto-update of old JMeter test plans.

Can you provide the simplest Test plan that fails?
If it's not possible to release the information (even after redacting sensitive information), maybe you can compare a Test Plan that fails with a newly created version of the same plan.
Comment 2 alexander.hertlein 2012-02-07 15:35:03 UTC
Created attachment 28277 [details]
Testplan + CSV

I was able to reproduce this also with a testplan  newly created with 2.6. (see attachment)
So what I see here:
- Module Controller 1 somehow influences Module Controller 2
- Deactivating Module Controller 1 fixes the problem
- only CSV Data Set Config is affected
- only the Module Controller 2 is affected
Comment 3 alexander.hertlein 2012-02-07 15:44:46 UTC
changing back to NEW
Comment 4 Sebb 2012-02-08 01:55:48 UTC
Thanks for the test case; I can confirm that there is a problem.

It seems to be a bug in the Transaction Controller - try disabling "Generate parent sample"; the code seems to work OK for me then.

When parent sample is selected, it looks like the TC keeps triggering the CSVData set to read the next line until EOF. It does not seem to invoke the sampler at all.
Comment 5 alexander.hertlein 2012-02-08 09:01:26 UTC
Created attachment 28283 [details]
Testplan without Transaction Controllers + CSV

First I deactivated "generate parent sample" which doesn't fix the problem.
Then I replaced transaction controllers with simple controllers, still the same problem. (see attachment)
Comment 6 alexander.hertlein 2012-02-09 12:35:44 UTC
Created attachment 28293 [details]
testplan without Module Controllers + CSV

I have found the root of the problem now:
If a testplan contains:
-2 CSV Data Set Configs pointing to the same CSV file
or
-2 Module Controllers pointing to the same CSV Data Set config (wich some how is the same like having 2 CSV Data Set Configs pointing to the same CSV file, i guess)

I attached a simple testplan where this problem is clearly visible.

Note:
-this works perfectly in 2.4
Comment 7 Philippe Mouawad 2012-02-10 14:14:12 UTC
Hello,
First thanks very much for investigating and trying to give us the cleanest Test Plan.

This "regression" has been introduced in 2.5 by bug fix to 50032 (see also 50618).
The pb comes from the fact that 

I am not sure it should be fixed, because looking at the 3 Test Plans, I wonder why you put the CSV Dataset inside the loop ?
I understand you want to loop on it but why not put it as Test Plan child and change it's sharing mode ?


I wait for your answer and we will decide on dev list what to do.
Thanks
Regards
Philippe
Comment 8 Philippe Mouawad 2012-02-10 14:22:31 UTC
Created attachment 28298 [details]
Possible Patch to issue
Comment 9 Philippe Mouawad 2012-02-10 14:23:49 UTC
Created attachment 28299 [details]
Test Plan showing issue and using Debug Sampler
Comment 10 Philippe Mouawad 2012-02-10 14:31:12 UTC
(In reply to comment #7)
> Hello,
> First thanks very much for investigating and trying to give us the cleanest
> Test Plan.
> 
> This "regression" has been introduced in 2.5 by bug fix to 50032 (see also
> 50618).
> The pb comes from the fact that a reInitializeSubController is called when IfController condition is false, this triggers CVSDataSet#iterationStart which ends up consuming the whole CSV file.

> 
> I am not sure it should be fixed, because looking at the 3 Test Plans, I wonder
> why you put the CSV Dataset inside the loop ?
> I understand you want to loop on it but why not put it as Test Plan child and
> change it's sharing mode ?
> 
> 
> I wait for your answer and we will decide on dev list what to do.
> Thanks
> Regards
> Philippe
Comment 11 Philippe Mouawad 2012-02-10 14:37:16 UTC
Note that with provided patch, a StackOverflowError will be generated on attached Test Plan as the If Controller has a condition that is always false from the first iteration.
Comment 12 Philippe Mouawad 2012-02-10 14:42:47 UTC
With my attached Test Plan and the previous one:
2.5 => java.lang.StackOverflowError
2.5.1 => Same behaviour as 2.6
Comment 13 Philippe Mouawad 2012-02-12 22:29:57 UTC
Created attachment 28304 [details]
Possible Patch to issue v2
Comment 14 alexander.hertlein 2012-02-13 10:20:02 UTC
> I understand you want to loop on it but why not put it as Test Plan child and
> change it's sharing mode ?

We want to iterate through the CSV within the thread. Not read next csv line on each thread iteration.
Comment 15 Philippe Mouawad 2014-12-06 15:43:00 UTC
This issue is fixed since JMeter 2.12 as part of 56160.

Thanks for feedback.

*** This bug has been marked as a duplicate of bug 56160 ***