apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.11k stars 2.06k forks source link

[PATCH] Modified CSV Data Set for independent file reading #2072

Closed asfimport closed 16 years ago

asfimport commented 16 years ago

Frank Schneider (Bug 44418): Hello,

this is my first patch for JMeter. If you have two or more CSV Data Sets in your test plan, which use the same file you may have a problem (like me). The file is only opened once (one instance). So every read from a CSV-file (regardless of which thread) will cause a jump to the next line. I wrote a patch so you can choose in the CSV-Data Set whether the file reading shall be independet (the file will be opened again even it is already open ) or not (the old behavior). A screenshot is also added to the archive.

Please contact me if you have questions or annotations.

Thanks

OS: All

asfimport commented 16 years ago

Frank Schneider (migrated from Bugzilla): Created attachment new_CSVDataSet.tar.gz: Patch with Screenshot

asfimport commented 16 years ago

Frank Schneider (migrated from Bugzilla): Here is a testplan for my patch. You need beanshell for this. Two threads with two CSV Data Sets are reading from the same csv-file. Without my patch the output (print) is like: line1 line2

with my patch you can set on both CSV-Data Sets "Independent CSV-Data reading" to true: line1 line1

The csv-data is read independently. It doesn't matter if other threads are reading from the same file.

Created attachment Test.tar.gz: A testplan for my patch.

asfimport commented 16 years ago

Sebb (migrated from Bugzilla): Just tried the patch - it does not work reliably.

The FileServer relies on retrieving the FileEntry using just the file name as key, so if the same name is used more than once, the second entry will overwrite the first.

It is too restrictive to insist on unique file names.

For independent files, the FileServer could use the CSV Dataset instance (this) as the key.

There's also a typo in the patch - the new reserveFile parameter should be boolean, not Boolean.

asfimport commented 16 years ago

Tobias Henkel (migrated from Bugzilla): I've created a similar patch which makes the CSV Data Source optional independent. You can also specify, how many loops throug the file you want to do if recycle is TRUE.

Greetings

Created attachment jmeter.patch: Another patch for an independent CSV Data Source

asfimport commented 16 years ago

Frank Schneider (migrated from Bugzilla): Hey,

wow another patch! Thanks Tobias! I' ll test it too. Here is my new patch. My first patch was stupid. Thanks to Sebb for his comments. I hope you test my new patch and contact me.

Created attachment CSVDataSetpatch_2.txt: New patch for CSVDataSet

asfimport commented 16 years ago

Sebb (migrated from Bugzilla): The existing API needs to be retained, in case any 3rd party add-ons have used it. It's OK to add new methods, or new method signatures, but the old ones must still work as before.

Also, please ensure that patch files are uploaded as text, and don't contain unrelated changes.

asfimport commented 16 years ago

Frank Schneider (migrated from Bugzilla): Hey,

here is the full patch with API Doku changes. I hope this is what you wanted. If I forgot something or you have further questions please contact me.

Best regards

Created attachment CSVDataSetpatch_withApiDoku.txt: Patch for CSVDataSet for independent file reading with Doku changes

asfimport commented 16 years ago

Frank Schneider (migrated from Bugzilla): Hello,

is the patch ok or do I have to change anything? Please contact me if I can do something.

Thanks

asfimport commented 16 years ago

Sebb (migrated from Bugzilla): See also https://github.com/apache/jmeter/issues/1916

asfimport commented 16 years ago

Sebb (migrated from Bugzilla): Added options to restrict file sharing to thread group, thread etc

URL: http://svn.apache.org/viewvc?rev=654944&view=rev Log: https://github.com/apache/jmeter/issues/2072/42178 - CSV Dataset file handling improvements