-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Constant Throughput Timer is throwing a NullPointerException when using variables (vars.get) in "Target Throughput"-field #6165
Comments
Thanks for the quick answer.
However, after applying your changes, the result is still the same: NullPointerException and the Thread is not continuing.
I think, the Problem is, that vars.get("throughput") seems to be Null.
Von: Mohamed Ibrahim ***@***.***>
Gesendet: Freitag, 1. Dezember 2023 12:47
An: apache/jmeter ***@***.***>
Cc: Segieth, Christoph (LfSt) ***@***.***>; Author ***@***.***>
Betreff: Re: [apache/jmeter] The Constant Throughput Timer is throwing a NullPointerException when using variables (vars.get) in "Target Throughput"-field (Issue #6165)
Will that not be, ${__groovy(Float.parseFloat(vars.get("throughput")))}
—
Reply to this email directly, view it on GitHub<#6165 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BEMJOOZHBDZLR3OICYMHNUTYHG7UNAVCNFSM6AAAAABACWHTYWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZVHE4DQMRZGA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
Root cause
As Unfortunately, it is quite common for elements to implement At the same time, JMeter can't predict which properties would indeed be needed for execution of Impacted classesKeystoreConfig, SyncTimer, BoltConnectionElement, DataSourceElement, MongoSourceElement WorkaroundsThe workaround could be writing Another workaround could be using properties rather than variables. Of course, properties are global across threads, however, it might be enough in certain cases. Long-term solutiona) Add "variable declaration" block, so users could declare variables along with their initial values |
…nd PreciseThroughputTimer Previously, the timers might fail initialization in case variable was not present when test started. The current workaround is to avoid implementing TestStateListener in the timers so JMeter does not attempt evaluating all the properties before test starts. fixes apache#6165
Expected behavior
The Constant Throughput Timer is supposed to ensure the number of times a Use Case is executed within a minute.
How often the Use Case ist executed depends on the value specified in the Field "Target troughput (in samples per minute)"
The value in this case is a variable (${__groovy( vars.get("throughput").toDouble() )}).
Actual behavior
The Use Case is not being executed once and while the test is still running, no further actions are executed. It is stuck.
A NullPointerException occures: javax.script.ScriptException: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method toDouble() on null object.
The Issue #6162 might be similar.
Steps to reproduce the problem
The attached test.jmx should reproduce the problem.
jmeter.log
test.zip
The Constant Throughput Timer works as expcted with jmeter 5.5 and older, dispite having the same NullPointerException.
JMeter Version
5.6.2
Java Version
openjdk version "11.0.19" 2023-04-18 LTS
OS Version
Microsoft Windows [Version 10.0.14393]
The text was updated successfully, but these errors were encountered: