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

5.6.2: JDBC Sampler initialization failure makes test fail without any visible error #6174

Open
johnqa opened this issue Dec 13, 2023 · 4 comments

Comments

@johnqa
Copy link

johnqa commented Dec 13, 2023

Expected behavior

I am trying to test different DB with JMeter 5.6.2 and I expect for the test to run without issues.

As example JDBC Connection Configuration for MSSQL is in the attached picture.
JDBC Connection Configuration 5 6 2

Actual behavior

When I run the test, nothing happens. No logs are written, nothing seems to be executed, no users are running. But when I try to close jmeter I get an message saying that I cannot do that since there is a test running.

I enabled debug logs for jdbc execution but no extra logs are present.

When doing the same test in Jmeter 5.4.3 (see attached JDBC Connection Configuration for MSSQL) it works.
JDBC Connection Configuration 5 4 3

This does not happen for all types of DB. It works for mongodb, mysql, mariadb, but id does not work for postgresql and mssql.

I am using the same jar files for jdbc drivers put in lib folder of both versions of jmeter.

Steps to reproduce the problem

  1. Setup a test for MSSQL or Postgresql in Jmeter 5.6.2
  2. Run the test -> nothing happens, no logs are generated but also no results.
  3. Try to close jmeter -> error message popup saying that a test is running.
  4. Repeat with MSSQL 5.4.3 -> test is running successfully.

JMeter Version

5.6.2

Java Version

java version 11.0.16.1

OS Version

Microsoft Windows [version 10.0.19044.3693]

@vlsi
Copy link
Collaborator

vlsi commented Dec 18, 2023

Please attach the test plan that reproduces the issue

@vlsi vlsi added the need info label Dec 18, 2023
@johnqa
Copy link
Author

johnqa commented Dec 18, 2023

Please find attached the problematic jmx.
MSSQL_BugTest.zip

@vlsi
Copy link
Collaborator

vlsi commented Dec 18, 2023

The root cause is ${__time(yyyy-MM-dd hh:mm:sss)}
You should have ss instead of sss.
In any case, you'd better use query parameters rather than building the string with jmeter templates.

It is sad JMeter does not report errors from StandardJMeterEngine.notifyTestListenersOfStart

java.lang.IllegalArgumentException: Unable to parse date format yyyy-MM-dd hh:mm:sss
        at org.apache.jmeter.functions.TimeFunction.lambda$static$2(TimeFunction.java:80)
        at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$2(LocalLoadingCache.java:145)
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$14(BoundedLocalCache.java:2406)
        at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:2404)
        at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:2387)
        at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)
        at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:56)
        at org.apache.jmeter.functions.TimeFunction.execute(TimeFunction.java:137)
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:139)
        at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:114)
        at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:104)
        at org.apache.jmeter.testbeans.TestBeanHelper.unwrapProperty(TestBeanHelper.java:189)
        at org.apache.jmeter.testbeans.TestBeanHelper.prepare(TestBeanHelper.java:139)
        at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:243)
        at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:424)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.IllegalArgumentException: Too many pattern letters: s
        at java.base/java.time.format.DateTimeFormatterBuilder.parseField(DateTimeFormatterBuilder.java:2020)
        at java.base/java.time.format.DateTimeFormatterBuilder.parsePattern(DateTimeFormatterBuilder.java:1804)
        at java.base/java.time.format.DateTimeFormatterBuilder.appendPattern(DateTimeFormatterBuilder.java:1772)
        at java.base/java.time.format.DateTimeFormatter.ofPattern(DateTimeFormatter.java:566)
        at org.apache.jmeter.functions.TimeFunction.lambda$static$2(TimeFunction.java:77)
        ... 20 more

vlsi added a commit to vlsi/jmeter that referenced this issue Dec 19, 2023
Previously, the exceptions from TestStateListener.testStarted might
be unnoticed since the UI did not display them.

This change is a workaround to surface errors in common cases.

See apache#6174
vlsi added a commit to vlsi/jmeter that referenced this issue Dec 19, 2023
…BCTestElement

TestStateListener + TestBean cause issues like in apache#6174,
so we should remove empty implementations
vlsi added a commit to vlsi/jmeter that referenced this issue Dec 19, 2023
Previously, the exceptions from TestStateListener.testStarted might
be unnoticed since the UI did not display them.

This change is a workaround to surface errors in common cases.

See apache#6174
vlsi added a commit to vlsi/jmeter that referenced this issue Dec 19, 2023
…BCTestElement

TestStateListener + TestBean cause issues like in apache#6174,
so we should remove empty implementations
vlsi added a commit to vlsi/jmeter that referenced this issue Dec 19, 2023
…BCTestElement

TestStateListener + TestBean cause issues like in apache#6174,
so we should remove empty implementations
@vlsi vlsi changed the title Issue with JDBC Connection Configuration in Jmeter 5.6.2 5.6.2: JDBC Sampler initialization failure makes test fail without any visible error Dec 19, 2023
@vlsi vlsi added this to the 5.6.3 milestone Dec 19, 2023
@johnqa
Copy link
Author

johnqa commented Dec 19, 2023

Indeed that was the issue, but I still wonder why it works on 5.4.3.

Thanks for help!

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

2 participants