Skip to content
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

_timeshift function does not work with offset formatters #5224

Closed
asfimport opened this issue Jan 10, 2020 · 2 comments
Closed

_timeshift function does not work with offset formatters #5224

asfimport opened this issue Jan 10, 2020 · 2 comments

Comments

@asfimport
Copy link
Collaborator

Markus Wolf (Bug 64070):
The _timeshift function does not work with a formatter of the form
"yyyy-MM-DD'T'HH:mm:ssXXX". This is due to the fact that internally a LocalDateTime is used instead of a ZonedDateTime.
An exception java.time.temporal.UnsupportedTemporalTypeException with text Unsupported field: OffsetSeconds
is thrown.

Can be easily tested with the function helper

${__timeShift(yyyy-MM-DD'T'dd:HH:mm:ss.SSSZ,,P2D,,)}

I think this could be very easily fixed and make a great tool even greater.
As a workaround I created a bean shell script working with ZonedDateTime.

Severity: normal
OS: All

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
Thanks for the report and the nice words about JMeter.

Could you test the next nightly, if the changes fix your problems?
If they do, you can close this bug.

commit 40db97b
AuthorDate: Fri Jan 10 18:12:47 2020 +0100

_timeshift function does not work with offset formatters

https://github.com/apache/jmeter/issues/5224

.../org/apache/jmeter/functions/TimeShift.java | 40 ++++++++++++----------
.../jmeter/functions/TestTimeShiftFunction.java | 17 +++++++++
xdocs/changes.xml | 2 ++
3 files changed, 41 insertions(+), 18 deletions(-)

@asfimport
Copy link
Collaborator Author

Markus Wolf (migrated from Bugzilla):
Tested the nightly build from 10.01.2020. It works now, thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant