Bug 51002

Summary: Stop Thread if CSV file is not available
Product: JMeter - Now in Github Reporter: Luciana Moreira <moreira>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major CC: hauser
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: EmptyCSVEternalLoop.jmx

Description Luciana Moreira 2011-03-31 05:06:12 UTC
It would be very useful if the component CSV Data Set Config would have an option to "Stop Thread if no file available".

Currently I am able to do it via BeanShell and verification of the variables that should be available. However it does not seem to be the right place for it.

CSV Data Set Config already provides the option "Stop Thread on EOF", so I suppose the additional safeguard function should not be too difficult to implement.
Comment 1 Ralf Hauser 2011-03-31 05:41:18 UTC
the current situation can be quite unpleasant,

If the .csv file is not existing, the "CSV Data Set Config" doesn't instantiate the declared, comma-delimited variable names, but it loops as if the file contained an infinite number of CSV-records...

Possibly one could even argue that the file not being present is equivalent of having reached the EOF immediatly upon start.
If one follows this argumentation, the infinite loop should not happen if "Stop thread on EOF?" is true and not additional "Stop Thread if CSV file is not available" is needed
Comment 2 Ralf Hauser 2011-04-12 05:39:57 UTC
Created attachment 26876 [details]
EmptyCSVEternalLoop.jmx

if no .csv file is present and it is in combination with smtp sampler, this can lead to mail flooding attack
Comment 3 Sebb 2011-04-12 13:18:43 UTC
Went with the simplest solution, which is to treat IOError (e.g. not found) as EOF.
Comment 4 Ralf Hauser 2011-04-13 02:51:55 UTC
hmm, this fixed it, but in a way the user might get lost:
1) in View Results Tree, I don't see anything
2) when I run JMeter out of eclipse, nothing in the console there either

ok, JMeter log has it, but do users really always check that?

Would there be the possibility to raise a pop-up (provided jmeter is not run headless?)

2011/04/13 08:50:10 ERROR - jmeter.config.CSVDataSet: java.io.FileNotFoundException: /home/me/../data/Dev.csv (No such file or directory) 
2011/04/13 08:50:10 INFO  - jmeter.threads.JMeterThread: Stop Thread seen: org.apache.jorphan.util.JMeterStopThreadException: End of file detected
Comment 5 Sebb 2011-04-13 08:16:58 UTC
JMeter does not raise dialog boxes during running.

CSV Dataset is not run in the context of a sampler, so cannot flag the sample as failed either.

There are lots of other reasons why samples may fail that can only be reported via the log file; that's why users are always told to check the log file.
Comment 6 The ASF infrastructure team 2022-09-24 20:37:46 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2479