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

[BUG]性能测试场景beanshell脚本调用lettuce-core-6.3.0.RELEASE.jar链接redis集群,在场景执行时,响应台报错。接口测试场景用例执行正常。 #30137

Closed
tianyihuhu opened this issue Apr 8, 2024 · 5 comments
Assignees
Labels
状态:待处理 已分配给相关处理人等待处理人处理并更新状态

Comments

@tianyihuhu
Copy link

联系方式

huxueyan_will@126.com

MeterSphere 版本

v2.10.8-lts-313def9d

使用外置数据库

问题描述

我们创建一个接口场景,大致的实现内容为:一个登录的接口,需要输入短信验证码,短信验证码存在redis里,我们就写了一个jar调用redis库,采用了beanshell的方式,然后获取验证码就登录接口登录。目前出现的问题是,场景用例在接口调试时正常执行,代码不会报错。但是性能测试时,代码总是报错。
1
高级配置中设置了路径,执行也是报错。

重现步骤

1.创建接口场景,链接redis获取某key值,在调用某登录接口
2.创建性能测试用例,执行查看控制台是否报错即可
代码为:import io.lettuce.core.ReadFrom;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI;
import io.lettuce.core.api.sync.RedisCommands;
import io.lettuce.core.codec.StringCodec;
import io.lettuce.core.masterreplica.MasterReplica;
import io.lettuce.core.masterreplica.StatefulRedisMasterReplicaConnection;

import java.util.ArrayList;
import java.util.List;

//集群节点

List uris = new ArrayList();
uris.add(RedisURI.builder().withSentinel("IP", port,"mm").withSentinelMasterId("mymaster").withPassword("mm").withDatabase(2).build());

RedisClient client = RedisClient.create();
StatefulRedisMasterReplicaConnection connection = MasterReplica.connect(client, StringCodec.UTF8, uris);
//从节点读取数据
connection.setReadFrom(ReadFrom.REPLICA);
RedisCommands commands = connection.sync();
ss = vars.get("ss");
vars.put("mlcode",commands.get(ss));
log.info(commands.get(ss));
connection.close();
client.shutdown();
将指定的链接内容替换一下使用

期待的正确结果

不报错,正常执行,目前看可能没有获取到jar包

相关日志输出

2024-04-08 17:49:35,563 Problem in JSR223 script 向redis里插入对应的手机验证码, message: javax.script.ScriptException: Sourced file: inline evaluation of: ``import io.lettuce.core.ReadFrom; import io.lettuce.core.RedisClient; import io.l . . . '' : Typed variable declaration : Method Invocation RedisClient.create : at Line: 27 : in file: inline evaluation of: ``import io.lettuce.core.ReadFrom; import io.lettuce.core.RedisClient; import io.l . . . '' : RedisClient .create ( )

Target exception: java.lang.NoClassDefFoundError: reactor/core/scheduler/Schedulers
in inline evaluation of: ``import io.lettuce.core.ReadFrom; import io.lettuce.core.RedisClient; import io.l . . . '' at line number 27 javax.script.ScriptException: Sourced file: inline evaluation of: ``import io.lettuce.core.ReadFrom; import io.lettuce.core.RedisClient; import io.l . . . '' : Typed variable declaration : Method Invocation RedisClient.create : at Line: 27 : in file: inline evaluation of: ``import io.lettuce.core.ReadFrom; import io.lettuce.core.RedisClient; import io.l . . . '' : RedisClient .create ( )

Target exception: java.lang.NoClassDefFoundError: reactor/core/scheduler/Schedulers
in inline evaluation of: ``import io.lettuce.core.ReadFrom; import io.lettuce.core.RedisClient; import io.l . . . '' at line number 27
at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:87) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:231) ~[java.scripting:?]
at org.apache.jmeter.util.JSR223TestElement.processFileOrScript(JSR223TestElement.java:252) ~[ms-jmeter-core.jar:5.5]
at org.apache.jmeter.protocol.java.sampler.JSR223Sampler.sample(JSR223Sampler.java:72) ~[ApacheJMeter_java.jar:5.5]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:670) ~[ms-jmeter-core.jar:5.5]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:588) ~[ms-jmeter-core.jar:5.5]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:500) ~[ms-jmeter-core.jar:5.5]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:264) ~[ms-jmeter-core.jar:5.5]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NoClassDefFoundError: reactor/core/scheduler/Schedulers
at io.lettuce.core.resource.DefaultClientResources.<init>(DefaultClientResources.java:214) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.resource.DefaultClientResources$Builder.build(DefaultClientResources.java:658) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.resource.DefaultClientResources.create(DefaultClientResources.java:275) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.AbstractRedisClient.<init>(AbstractRedisClient.java:122) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.RedisClient.<init>(RedisClient.java:98) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.RedisClient.create(RedisClient.java:123) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at bsh.Reflect.invokeMethod(Reflect.java:131) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Reflect.invokeStaticMethod(Reflect.java:95) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Name.invokeMethod(Name.java:868) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:69) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHVariableDeclarator.eval(BSHVariableDeclarator.java:80) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:78) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Interpreter.eval(Interpreter.java:659) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Interpreter.eval(Interpreter.java:750) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Interpreter.eval(Interpreter.java:739) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:78) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
... 9 more
Caused by: java.lang.ClassNotFoundException: reactor.core.scheduler.Schedulers
at java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
at io.lettuce.core.resource.DefaultClientResources.<init>(DefaultClientResources.java:214) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.resource.DefaultClientResources$Builder.build(DefaultClientResources.java:658) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.resource.DefaultClientResources.create(DefaultClientResources.java:275) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.AbstractRedisClient.<init>(AbstractRedisClient.java:122) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.RedisClient.<init>(RedisClient.java:98) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at io.lettuce.core.RedisClient.create(RedisClient.java:123) ~[lettuce-core-6.3.0.RELEASE.jar:6.3.0.RELEASE/9bb1669]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at bsh.Reflect.invokeMethod(Reflect.java:131) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Reflect.invokeStaticMethod(Reflect.java:95) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Name.invokeMethod(Name.java:868) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:69) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHVariableDeclarator.eval(BSHVariableDeclarator.java:80) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.BSHTypedVariableDeclaration.eval(BSHTypedVariableDeclaration.java:78) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Interpreter.eval(Interpreter.java:659) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Interpreter.eval(Interpreter.java:750) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.Interpreter.eval(Interpreter.java:739) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:78) ~[bsh-2.0b6.jar:2.0b6 2016-02-05 05:16:19]
... 9 more

附加信息

lettuce-core-6.3.0.RELEASE.jar这个包需要自行下载

@github-actions github-actions bot added the 状态:待处理 已分配给相关处理人等待处理人处理并更新状态 label Apr 8, 2024
@liuruibin
Copy link
Member

通过报错能够看到少了部分jar reactor/core/scheduler/Schedulers

@github-actions github-actions bot added 状态:待用户反馈 and removed 状态:待处理 已分配给相关处理人等待处理人处理并更新状态 labels Apr 9, 2024
@tianyihuhu
Copy link
Author

tianyihuhu commented Apr 9, 2024 via email

@github-actions github-actions bot added 状态:待处理 已分配给相关处理人等待处理人处理并更新状态 and removed 状态:待用户反馈 labels Apr 9, 2024
@liuruibin
Copy link
Member

性能测试单独启动的jmeter镜像,里面的jar和接口测试有很大的不同

@github-actions github-actions bot added 状态:待用户反馈 and removed 状态:待处理 已分配给相关处理人等待处理人处理并更新状态 labels May 9, 2024
@youliyuan-fit2cloud
Copy link

你好,因为长时间未反馈,暂关闭该issue,如果后续仍遇到请随时联系我们,感谢理解和支持。

@tianyihuhu
Copy link
Author

tianyihuhu commented May 23, 2024 via email

@github-actions github-actions bot added 状态:待处理 已分配给相关处理人等待处理人处理并更新状态 and removed 状态:待用户反馈 labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
状态:待处理 已分配给相关处理人等待处理人处理并更新状态
Projects
None yet
Development

No branches or pull requests

4 participants