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

Unexpected integer rounding #422

Open
themreza opened this issue Jul 12, 2023 · 0 comments
Open

Unexpected integer rounding #422

themreza opened this issue Jul 12, 2023 · 0 comments

Comments

@themreza
Copy link

themreza commented Jul 12, 2023

Proto file(s)

syntax = "proto3";
package protos;

option go_package = "/protos";

message TestRequest {
  sfixed64 id = 1;
}

message TestResponse {
  sfixed64 id = 1;
}

service TestService {
  rpc Echo (TestRequest) returns (TestResponse);
}

Command line arguments / config

ghz --insecure \
      --proto schema/test.proto \
      --call protos.TestService.Echo \
      -d '{ "id": 1000000000000000089 }' \
      -n 1 \
      0.0.0.0:9009

# Server log:
# Id:  1000000000000000100

Describe the bug

ghz is rounding the sfixed64 integer, which can result in confusion and incorrect test results.

1000000000000000089 is rounded up to 1000000000000000100.

10000000000000089 is rounded down to 10000000000000088.

Tests made with Postman:

image
image

Server log:

Id:  10000000000000089
Id:  1000000000000000089

To Reproduce

See this repository: https://github.com/themreza/ghz-test-sfixed64/tree/main

Expected behavior

The request sent to the server must match the call data argument.

Environment

  • OS: Ubuntu 20.04
  • ghz: v0.117.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant