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

gRPC with jmeter is not working in alpine/jmeter:5.6.3 image #6404

Open
PraveenDhasarathan opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@PraveenDhasarathan
Copy link

Expected behavior

Jmeter should be able to run the gRPC request sampler inside the image

Actual behavior

Getting a below error:
2025-01-08 10:33:25,530 ERROR v.z.b.GRPCSampler: java.lang.RuntimeException: Unable to resolve service by invoking protoc:
Unable to execute protoc binary
at vn.zalopay.benchmark.core.ClientCaller.init(ClientCaller.java:88)
at vn.zalopay.benchmark.core.ClientCaller.(ClientCaller.java:53)
at vn.zalopay.benchmark.GRPCSampler.initGrpcClient(GRPCSampler.java:81)
at vn.zalopay.benchmark.GRPCSampler.initGrpcInCurrentThread(GRPCSampler.java:203)
at vn.zalopay.benchmark.GRPCSampler.initGrpcRequestSampler(GRPCSampler.java:133)
at vn.zalopay.benchmark.GRPCSampler.sample(GRPCSampler.java:90)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
at java.lang.Thread.run(Thread.java:750)

Steps to reproduce the problem

Create a Docker file:
FROM alpine/jmeter:5.6.3
// Copied the below library from my local jmeter 5.6.3
COPY ./lib/jmeter-grpc-request.jar /opt/apache-jmeter-5.6.3/lib/ext/jmeter-grpc-request.jar
COPY ./lib/jmeter-plugins-manager-1.10.jar /opt/apache-jmeter-5.6.3/lib/ext/jmeter-plugins-manager-1.10.jar
RUN apk add protobuf
COPY ./scripts/GRPC_Request.jmx /opt/apache-jmeter-5.6.3/scripts/GRPC_Request.jmx

Docker build command:
docker build . -t load-testing:manager-load-testing_v1 --no-cache

Create a proto file:
syntax = "proto3";

package com.grpc.spring;
option java_package = "com.grpc.spring.service";
option java_outer_classname = "Solutions";
option java_generic_services = true;
option java_multiple_files = true;

service SolutionService {
rpc getSolution (SolutionRequest) returns (SolutionResponse) {};
}

message SolutionRequest {
string name = 1;
}
message SolutionResponse {
string message = 1;
}

I created a Jmeter GRPC request sampler using the UI and copied the Jmeter script to an image and used the below command to run the Docker image:
docker run -it --entrypoint bash --rm --user root load-testing:manager-load-testing_v1

jmeter -n -t scripts/GRPC_Request.jmx -l result.jtl -JThreads=1 -JRamup=1 -JLoopCount=1 -JprotoFilePath=/opt/apache-jmeter-5.6.3/scripts/test_data -Jhost=host.docker.internal -Jport=9092 -e -o ./dashboard_directory

Note: Same script works in my local JMeter GUI. which has protoc version as local: libprotoc 28.3 but in the Image: libprotoc 24.4

JMeter Version

5.6.3

Java Version

openjdk version "1.8.0_432"

OS Version

Alpine Linux v3.21

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