In case multiple computers running JMeter servers are shared and could be used by different users running JMeter in client mode to run tests, the remote JMeter engine implementation should throw an exception (e.g. in configure) when it currently still is executing a test (that could be started by another JMeter client instance). The current implementation stops the test it currently is running and starts the new one.
Agreed, the current behaviour is not ideal. I don't know how easy it is to determine when the test has finished.
StandardJMeterEngine has private volatile boolean running = false; maybe this could be read when Configure or runTest is called, and throw an exception which would be communicated back to RemoteJMeterEngineImpl and then back over RMI to the local JMeter instance?
(In reply to comment #0) > > The current implementation stops the test it currently is running and starts > the new one. Are you sure? I just tried running 2 tests at once, and the server coped fine. However, there is a small window between configuring a test and running it, in which case the original engine will be overwritten. I suppose it's possible you hit that window? == It is possible to prevent more than one client running at once. This could be a server option (I don't think it should be enforced). Otherwise, the server engine startup code should somehow ensure that the clients cannot interfere with each other.
Oops! Just realised that although a simple test such as the one I ran may work OK, the design of JMeter assumes that only one test is runninng at any one time. For example, there is only one set of JMeter properties. Changing this would be a big undertaking, if it is indeed possible. So it is necessary for the server to reject attempts to run two tests at once. The 'running' flag is unfortunately not suitable, as it is true only whilst the main test is running - it is false during startup and shutdown. However it's easy enough to add another boolean.
Fixed: URL: http://svn.apache.org/viewvc?rev=1066684&view=rev Log: Bug 50659 - JMeter server does not support concurrent tests - prevent client from starting another Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/JMeterEngine.java jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/RemoteJMeterEngineImpl.java jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java jakarta/jmeter/trunk/xdocs/changes.xml
(In reply to comment #5) > Fixed: > URL: http://svn.apache.org/viewvc?rev=1066684&view=rev Hi, I don't like the usability in the catch ServerException block in ClientJMeterEngine where you use System.exit(1); to exit JMeter. In case of a Gui-Run I would inform the user that the one of the used JMeter Servers is executing a test right now.
Good catch - I had only tested using non-GUI. Needs to be looked at further.
Turned out to be a bit involved, but I think I've now fixed the code. The fix is in nightly builds from r1067038. If you can try one out and report back, that would be very helpful. URL: http://svn.apache.org/viewvc?rev=1067038&view=rev Log: Bug 50659 - JMeter server does not support concurrent tests - prevent client from starting another (part deux) Remove thread from ClientJMeterEngine - if it is required for GUI, then let the GUI create the thread This allows proper return of error conditions Also replace System.exit() with interrupt() of RMI thread Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/ClientJMeterEngine.java
(In reply to comment #8) > Turned out to be a bit involved, but I think I've now fixed the code. > > The fix is in nightly builds from r1067038. > Thanks. Commit 1067029 is also related I found out. Can you explain me what that owner thread checking is about in RemoteJMeterEngineImpl?
(In reply to comment #9) > Can you explain me what that owner thread checking is about in > RemoteJMeterEngineImpl? Start up involves 2-3 method calls: - config - setProperties (optional) - runTest Without owner checking, client A could call config, then client B, then client A could call runTest - which would use the wrong test plan. Likewise for reset(), only the owner is allowed to reset, otherwise the GUI can kill off another test (I think this must be what you were experiencing originally).
> Without owner checking, client A could call config, then client B, then client > A could call runTest - which would use the wrong test plan. > > Likewise for reset(), only the owner is allowed to reset, otherwise the GUI can > kill off another test (I think this must be what you were experiencing > originally). Ok, all right - thanks!
*** Bug 43168 has been marked as a duplicate of this bug. ***
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2458