You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "kkrrsq (via GitHub)" <gi...@apache.org> on 2024/06/03 05:51:43 UTC
[I] How to detect the test end while JMeter starts the test errors in Java [jmeter]
kkrrsq opened a new issue, #6284:
URL: https://github.com/apache/jmeter/issues/6284
### Expected behavior
_No response_
### Actual behavior
I have a Java program that uses the StandardJMeterEngine runTest method to run tests. When the JMX file contains an errors that causes the StandardJMeterEngine notifyTestListenersOfStart method to throw an exception, similar to https://github.com/apache/jmeter/issues/6174, the NotifyTestListenersOfEnd method will not be called. As a result, my program cannot detect that the test has ended. How can I make my program detect that the test has ended in this scenario?
### Steps to reproduce the problem
1.Create a JMX file with an error, for example by adding a variable ${__intSum(${__time(,)},-3600000,)}, which will throw a NumberFormatException.
2.Run the JMX using the StandardJMeterEngine runTest method.
### JMeter Version
5.6.2
### Java Version
java version 17.0.6
### OS Version
windows 10
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to detect the test end while JMeter starts the test errors in Java [jmeter]
Posted by "linvaux (via GitHub)" <gi...@apache.org>.
linvaux commented on issue #6284:
URL: https://github.com/apache/jmeter/issues/6284#issuecomment-2274803788
```java
StandardJMeterEngine engine = new StandardJMeterEngine();
if (engine.isActive()){
println("Jmeter is running");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to detect the test end while JMeter starts the test errors in Java [jmeter]
Posted by "linvaux (via GitHub)" <gi...@apache.org>.
linvaux commented on issue #6284:
URL: https://github.com/apache/jmeter/issues/6284#issuecomment-2558132488
Yes, there is a question about the answer I provided, and I'll look into whether there is a good plan.
> > ```java
> > StandardJMeterEngine engine = new StandardJMeterEngine();
> > if (engine.isActive()){
> > println("Jmeter is running");
> > }
> > ```
>
> This method is not useful because runTest is an asynchronous method, so I can't catch exceptions after calling runTest. My temporary solution is to compile hashTree once before runTest.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] How to detect the test end while JMeter starts the test errors in Java [jmeter]
Posted by "kkrrsq (via GitHub)" <gi...@apache.org>.
kkrrsq commented on issue #6284:
URL: https://github.com/apache/jmeter/issues/6284#issuecomment-2553271801
> ```java
> StandardJMeterEngine engine = new StandardJMeterEngine();
> if (engine.isActive()){
> println("Jmeter is running");
> }
> ```
This method is not useful because runTest is an asynchronous method, so I can't catch exceptions after calling runTest. My temporary solution is to compile hashTree once before runTest.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org