weillercarvalho opened a new issue, #6609:
URL: https://github.com/apache/jmeter/issues/6609
### Expected behavior
The ` __RandomDate` function should treat the provided end date as
inclusive. When the start and end dates are the same, the function should
simply return that single date (and store it in the target variable) instead of
failing.
### Actual behavior
- When `startDate < endDate`, the function never returns the configured end
date. It behaves as if the interval were [start, end) (exclusive upper bound).
- When `startDate == endDate`, the call to
`ThreadLocalRandom.nextLong(start, end)` raises `IllegalArgumentException:
bound must be greater than origin`, so the function errors out instead of
returning the only valid date.
### Steps to reproduce the problem
1. Create a test plan with a Debug Sampler and a Simple Data Writer (or
just watch the Debug Sampler output).
2. Add a User Parameters or a JSR223 Sampler to evaluate`
${__RandomDate(yyyy-MM-dd,2111-03-29,2111-03-30,,MY_VAR)}`.
3. Run the plan multiple times. Observe that the logged value is always
`2111-03-29` and `MY_VAR` never contains `2111-03-30`.
4. Change the call to
`${__RandomDate(yyyy-MM-dd,2111-03-29,2111-03-29,,MY_VAR)}` and run again. The
sampler now fails with the `IllegalArgumentException` mentioned above.
### JMeter Version
6.0.0-SNAPSHOT
### Java Version
OpenJDK Runtime Environment 21.0.8 (2025-07-16)
### OS Version
Linux 6.6.87.2-microsoft-standard-WSL2 (running under Windows 11 / WSL2)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]