ResultCollector tries to ensure that multiple references to the same file in a Test Plan only generate a single Writer. However, it does not canonicalise the file names, so the same physical file may be written by two Writers. For example, test.jtl and ./test.jtl will result in separate entries in the files HashMap. This could be fixed by using File.getCanonicalPath() Also test.jtl and Test.jtl currently generate separate entries even on case-insensitive file systems. There does not seem to be a way to detect file system case-sensitivity in Java. Path.toRealPath() produces unique names for case-insenstive systems but only works for existing files, so would require the file to be exist first. That might be acceptable here, because the purpose of the ResultCollector is to write the file. File.toCanonicalPath() does not take account of case sensitivity. It looks as though File.getCanonicalPath() returns the file name with its actual case if the file exists. Note that case-sensitivity is a property of the file system, not the OS, so the same host could potentially have multiple file systems with different case-sensitivity
Created attachment 34801 [details] Test showing problem
Created attachment 34802 [details] output XML file showing mixed output
Created attachment 34803 [details] Test showing problem for CSV
Created attachment 34804 [details] output CSV file showing truncated output
Note: as it happens the first call to initializeFileOutput() creates the file if it does not exist, so File.getCanonicalPath() is sufficient to ensure uniqueness. Also added some debug logging to show when file is created/initialised. URL: http://svn.apache.org/viewvc?rev=1785990&view=rev Log: ResultCollector does not ensure unique file name entries in files HashMap Bugzilla Id: 60822 Modified: jmeter/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java jmeter/trunk/xdocs/changes.xml
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4320