-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 module is not registering protobuf nested messages #3160
Comments
Hi @thiagodpf, thanks for reporting this 🙇 This seems like a big miss on our side, at least at first glance. Are nested types used often? Are they a new feature, by any chance? This code is also a little over a year old which seems like this is just not used all that much 🤔 ? I am mostly asking to know just how likely is we have broken something instead of it just not working ever and nobody has been using it. I expect that later is the case, so I will mark this is an enhancement.
I don't think someone has reported this before or that we have started a fix. A PR is welcome here, if you want to do it. I would probably propose doing it against the xk6-grpc repo, and we can transfer it in standard after that (potentially even in the same release). Thanks again for the reporting this 🙇 |
I think nested types have been supported in protobuf for some time now, but in practice it's hard to see anyone use it. I don't use it myself, but I decided to take advantage of a googleapis-rpc error_details.proto for error handling and that googleapis I think the problem only happens when using the Here's an example: The error in the image above means that the response received via Stream is not forwarded to the javascript (since it was not possible to marshal the json fragment of the If I don't run k6 in // ...in my load test script...
stream.on('data', (response) => {
console.log("Response arrived") // <-- this log was not being called
console.log(response)
}); |
That said, I'm going to propose via PR a change to this code snippet to consider nested messages as well: Do you have a preference for the type of algorithm for traversing nested types? I can avoid a recursive function using a "Queue" or "Stack" (like those algorithms used to traverse graphs), but I think a recursion would be simpler to read, and also because so many levels of nested types in |
I am not certain how you got the logged line you got. Looking at the code It seems to me you eitehr should have
I don't think it matters so much. I do feel like having it be none recursive is actually going to be just as much code, but I propose you just do it, and we can figure out if it makes sense.
I have no idea - if we expect no more then 2-3 levels and at 10 we have practically no examples 👍 . I am not certain at what level this will be a problem either way, as I expect reading and parsing such a deeply neseted proto buf file is likely going to be more problematic then our handling of it 🤷 |
🔹 About this:
I only got that log because I was debugging the code to understand what was going on. Actually I forced that log in the terminal debugging through VSCode: If I run k6 in
🔹 About algorithm to traverse nested message structure, I will propose something tonight ✌️😁 |
@mstoykov I believe that I will need your guidance to proceed with the tests, in order to be able to reproduce (in the xk6-grpc repo) the problem I reported. TL;DR Could you tell me if there are test cases in which the process that runs the gRPC server is different from the process that runs the client? It seems to me that this code here (which represents the gRPC server) should run separately from the client, right? Could I run a test case that makes use of this server? Long story, go get a coffee and clear your mind to try to understand the problem... So that I can reproduce the error I'm having, I need to find a test scenario that takes me closer to that of real k6, where I only need to inform the I think it will be difficult for me to explain this (and I already see myself repeating the same thing), but... 😅 Here's an If this For it to be I'm sorry for being so long-winded, but do you get the idea? |
just to put you in context, I tried running this test file and it didn't work because it runs the client and server on the same binary. |
@thiagodpf good catch 🙇 - yeah, turns out that the tests for this functionality don't really do anything at this point. After a quick internal discussion we do think that:
So our proposal is that:
This way we can get the actual fix and later figure out the exact way to test it going forward. You are also welcome to actually contribute a way to run the tests in separate processes. |
Perfect! I will try to demonstrate the problem according to your guidance. By the way, the branch I should use is the Running tool: /usr/local/go/bin/go test -timeout 30s -run ^(TestClient|TestDebugStat)$ github.com/grafana/xk6-grpc/grpc
2023/07/05 10:06:51 http: TLS handshake error from 127.0.0.1:37952: remote error: tls: bad certificate
--- FAIL: TestClient (0.00s)
--- FAIL: TestClient/Close (0.02s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/Close
--- FAIL: TestClient/UnknownConnectParam (0.02s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/UnknownConnectParam
--- FAIL: TestClient/LoadNotInit (0.00s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/LoadNotInit
--- FAIL: TestClient/SentMessageLargerThanMax (0.02s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/SentMessageLargerThanMax
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: "GoError: method \"/grpc.testing.TestService/UnaryCall\" not found in file descriptors at reflect.methodValueCall (native)" does not contain "trying to send message larger than max"
Test: TestClient/SentMessageLargerThanMax
--- FAIL: TestClient/RequestMessage (0.03s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/RequestMessage
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.testing.TestService/UnaryCall" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/RequestMessage
--- FAIL: TestClient/ResponseTrailers (0.03s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ResponseTrailers
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.testing.TestService/EmptyCall" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/ResponseTrailers
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:444
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:29
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Should be true
Test: TestClient/ResponseTrailers
Messages: url example.com:42957/grpc.testing.TestService/EmptyCall didn't emit grpc_req_duration
--- FAIL: TestClient/ReceivedMessageLargerThanMax (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ReceivedMessageLargerThanMax
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: "GoError: method \"/grpc.testing.TestService/UnaryCall\" not found in file descriptors at reflect.methodValueCall (native)" does not contain "received message larger than max"
Test: TestClient/ReceivedMessageLargerThanMax
--- FAIL: TestClient/ResponseError (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ResponseError
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.testing.TestService/EmptyCall" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/ResponseError
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:384
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:29
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Should be true
Test: TestClient/ResponseError
Messages: url example.com:42013/grpc.testing.TestService/EmptyCall didn't emit grpc_req_duration
--- FAIL: TestClient/ResponseHeaders (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ResponseHeaders
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.testing.TestService/EmptyCall" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/ResponseHeaders
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:414
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:29
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Should be true
Test: TestClient/ResponseHeaders
Messages: url example.com:33771/grpc.testing.TestService/EmptyCall didn't emit grpc_req_duration
--- FAIL: TestClient/Connect (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/Connect
--- FAIL: TestClient/InvokeAnyProto (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_any_testing/any_test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_any_testing/any_test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/InvokeAnyProto
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.any.testing.AnyTestService/Sum" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/InvokeAnyProto
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:282
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:29
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Should be true
Test: TestClient/InvokeAnyProto
Messages: url example.com:34933/grpc.any.testing.AnyTestService/Sum didn't emit grpc_req_duration
--- FAIL: TestClient/Invoke (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/Invoke
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.testing.TestService/EmptyCall" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/Invoke
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:234
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:29
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Should be true
Test: TestClient/Invoke
Messages: url example.com:35457/grpc.testing.TestService/EmptyCall didn't emit grpc_req_duration
--- FAIL: TestClient/NoConnect (0.00s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: "GoError: could not resolve path \"../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto\": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)" does not contain "invoking RPC methods in the init context is not supported"
Test: TestClient/NoConnect
--- FAIL: TestClient/InvokeNilRequest (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/InvokeNilRequest
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: "GoError: method \"/grpc.testing.TestService/EmptyCall\" not found in file descriptors at reflect.methodValueCall (native)" does not contain "request cannot be nil"
Test: TestClient/InvokeNilRequest
--- FAIL: TestClient/InvokeInit (0.00s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: "GoError: could not resolve path \"../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto\": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)" does not contain "invoking RPC methods in the init context is not supported"
Test: TestClient/InvokeInit
--- FAIL: TestClient/ConnectInit (0.00s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:22
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: "GoError: could not resolve path \"../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto\": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)" does not contain "connecting to a gRPC server in the init context is not supported"
Test: TestClient/ConnectInit
--- FAIL: TestClient/InvokeNotFound (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/InvokeNotFound
--- FAIL: TestClient/Load (0.00s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/Load
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:25:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:25
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Expected value not to be nil.
Test: TestClient/Load
--- FAIL: TestClient/ResponseMessage (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ResponseMessage
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.testing.TestService/UnaryCall" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/ResponseMessage
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:52
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:356
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:29
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Should be true
Test: TestClient/ResponseMessage
Messages: url example.com:37779/grpc.testing.TestService/UnaryCall didn't emit grpc_req_duration
--- FAIL: TestClient/ConnectIntegerTimeout (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ConnectIntegerTimeout
--- FAIL: TestClient/RequestHeaders (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/RequestHeaders
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:676
Error: Received unexpected error:
GoError: method "/grpc.testing.TestService/EmptyCall" not found in file descriptors at reflect.methodValueCall (native)
Test: TestClient/RequestHeaders
--- FAIL: TestClient/ConnectFloatTimeout (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ConnectFloatTimeout
--- FAIL: TestClient/ConnectInvalidTimeout (0.00s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ConnectInvalidTimeout
--- FAIL: TestClient/ConnectStringTimeout (0.01s)
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19:
Error Trace: /home/thiagodepaulaferreira/github/xk6-grpc/grpc/helpers_test.go:19
/home/thiagodepaulaferreira/github/xk6-grpc/grpc/client_test.go:672
Error: Received unexpected error:
GoError: could not resolve path "../vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto": open /home/thiagodepaulaferreira/github/xk6-grpc/vendor/go.k6.io/k6/lib/testutils/httpmultibin/grpc_testing/test.proto: no such file or directory at reflect.methodValueCall (native)
Test: TestClient/ConnectStringTimeout
FAIL
FAIL github.com/grafana/xk6-grpc/grpc 1.035s
FAIL |
@thiagodpf I should've probably written you about this, but the So you can just run Sorry for the inconvenience. |
Very good tip! 🎉 I proposed a PR on that repository, check it out when you can. If you want to debug to understand the algorithm, it's very easy, basically it's a traversal of a tree structure. As for contributing ways to run the tests in separate processes, I'm afraid I'm not that familiar with github's CI 😅. But thank you for opening a point of discussion on the subject. 🙌 |
Hey folks!
I noticed that modules
k6/net/grpc
andk6/experimental/grpc
are not registering the nested types defined in my.proto
file. This means that when receiving the response (via stream) from the server, it is not possible to generate a javascript object via marshaling (and thus I am not able to proceed with the load test).I've been debugging the code and saw that the fix could be made at this point (based on the module
k6/experimental/grpc
):k6/vendor/github.com/grafana/xk6-grpc/grpc/client.go
Lines 285 to 295 in 6137c5e
Note that the above algorithm only goes through the first level
messages
of the.proto
file, but it is possible that a message has a list of nested messages and so on recursively. It is possible to adjust the algorithm to traverse the data structure (tree) without the need to perform a recursion, although a recursion would be much simpler, since nobody defines so many nested levels.Do you already have this fix mapped out to be resolved or can I propose a Pull Request?
The text was updated successfully, but these errors were encountered: