Hi, I think there is a bug with the new grpc server reflection support, but posting here to check. I have a simple unary grpc request I’m trying to get working with server reflection. I’ve copied the example from the release notes, but am getting this error during the grpc client connect.
Hi @inanc. Here is the script. If you need the proto files will need to send that directly.
var grpc = require(“k6/net/grpc”);
var client = new grpc.Client();
module.exports.options = {
iterations: 1
};
module.exports.default = function() {
client.connect(“localhost:50051”, {plaintext: true, reflect: true});
var payload = { };
var res = client.invoke(“tenant.grpc.ApplicationService/get”, payload);
if (!k6.check(res, {“ApplicationService get status is OK”: function(r) {return r && r.status === grpc.StatusOK}})){
k6.fail(“ApplicationService get failed”);
};
client.close();
};
Hi @itide,
I tested your shared code with our test grpc service, it works fine.
import k6 from "k6"
var grpc = require("k6/net/grpc");
var client = new grpc.Client();
module.exports.options = {
iterations: 1
};
module.exports.default = function() {
client.connect("grpcbin.test.k6.io:9001", {reflect: true});
var payload = { };
var res = client.invoke("hello.HelloService/SayHello", payload);
if (!k6.check(res, {"ApplicationService get status is OK": function(r) {return r && r.status === grpc.StatusOK}})){
k6.fail("ApplicationService get failed");
};
client.close();
};
Please, share your proto files in private so I can investigate more on it, you should also check that you are not defining multiple times any descriptor as the error message is spotting.