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.3k stars 2.09k forks source link

incomplete result file when remote testing with more than 1 server #2160

Closed asfimport closed 15 years ago

asfimport commented 15 years ago

frank.diedrich (Bug 45976): running a test with a couple of http-requests on e.g. 3 remote hosts ends up in a csv-result file that contains not all entries for the requests. The results from the host which finished first are complete, but all following results are lost.

To prove my assertion I did 2 runs (5 and 10 threads) of a test plan with 9-http-requests and inspected the logs (client-log, server-log and result-files are attached).

1st run: 9 requests x 5 user/threads = 45 samples per remote host expected start/end from client-log: jmeter.JMeter: Started remote host: server-3 (1223557140659) jmeter.JMeter: Started remote host: server-2 (1223557140672) jmeter.JMeter: Started remote host: server-1 (1223557140719) jmeter.JMeter: Finished remote host: server-1 (1223557162864) jmeter.JMeter: Finished remote host: server-3 (1223557163090) jmeter.JMeter: Finished remote host: server-2 (1223557163128) csv contains 45 samples from server-1, 41 from server-2 and 41 from server-3

2nd run: 9 requests x 10 user/threads = 90 samples per remote host expected jmeter.JMeter: Started remote host: server-2 (1223558448230) jmeter.JMeter: Started remote host: server-3 (1223558448236) jmeter.JMeter: Started remote host: server-1 (1223558448243) jmeter.JMeter: Finished remote host: server-3 (1223558491281) jmeter.JMeter: Finished remote host: server-1 (1223558491458) jmeter.JMeter: Finished remote host: server-2 (1223558491598) csv contains 90 samples from server-3, 84 from server-1 and 86 from server-2

Created attachment incompl_result_file.zip: logs from example runs

Severity: normal OS: Solaris

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): Were you running the client JMeter engine in non-GUI mode?

If so, what happens if you run in GUI mode? Do all the results get returned?

asfimport commented 15 years ago

frank.diedrich (migrated from Bugzilla):

Were you running the client JMeter engine in non-GUI mode?

yes, the examples were taken from the engine in non-GUI mode

what happens if you run in GUI mode? Do all the results get returned?

yes, all samples get returned

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): OK, thanks.

It looks like non-GUI mode is exitting before all the samples have been processed.

I'm not yet sure how that can happen.

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): Further investigation shows that test is finising normally, but the file is being closed too early. [Also, the same problem can occur in GUI tests.]

The files are written by the ResultCollector class. Its testEnded() method checks the Set of hosts to see if there are any other tests running. However this check is faulty, because the Set of hosts is local to the class instance, and there will be one instance per remote server.

==

A work-round in the meantime is to ensure that there is a pause at the end of the test plan. The pause must be long enough to ensure that the last sample reaches the client before the first test completes.

The Test Action sampler can be used for this as it does not generate a sample. If there is only one Thread Group in the test plan, then add a second thread group with one thread containing the Test Action sampler, and set the thread groups to run consecutively.

The bug only affects tests which run on multiple hosts at once.

asfimport commented 15 years ago

Sebb (migrated from Bugzilla): Fix committed to SVN trunk:

URL: http://svn.apache.org/viewvc?rev=703603&view=rev Log: https://github.com/apache/jmeter/issues/2160 - incomplete result file when using remote testing with more than 1 server

If you want to try this out, nightly builds after r703603 will have the fix.