Skip to content

Commit

Permalink
Merge pull request #15088 from fuweid/3.4-fix-flaky-testcase
Browse files Browse the repository at this point in the history
[3.4] grpc-gateway: update version to v1.11.0
  • Loading branch information
ahrtr authored Jan 13, 2023
2 parents 46511ab + c320f75 commit a577940
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/google/uuid v1.0.0
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.9.5
github.com/grpc-ecosystem/grpc-gateway v1.11.0
github.com/jonboulle/clockwork v0.1.0
github.com/json-iterator/go v1.1.11
github.com/modern-go/reflect2 v1.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.5 h1:UImYN5qQ8tuGpGE16ZmjvcTtTw24zw1QAp/SlnNrZhI=
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.11.0 h1:aT5ISUniaOTErogCQ+4pGoYNBB6rm6Fq3g1v8QwYGas=
github.com/grpc-ecosystem/grpc-gateway v1.11.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
Expand Down
14 changes: 12 additions & 2 deletions tests/e2e/v3_curl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ func testV3CurlProclaimMissiongLeaderKey(cx ctlCtx) {
if err = cURLPost(cx.epc, cURLReq{
endpoint: path.Join(cx.apiPrefix, "/election/proclaim"),
value: string(pdata),
expected: `{"error":"\"leader\" field must be provided","message":"\"leader\" field must be provided","code":2}`,
// NOTE: The order of json fields is aligned with the runtime.errorBody
//
// REF:
// 1. https://github.com/grpc-ecosystem/grpc-gateway/blob/v1.11.0/runtime/errors.go#L73
// 2. https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto#L82
expected: `{"error":"\"leader\" field must be provided","code":2,"message":"\"leader\" field must be provided"}`,
}); err != nil {
cx.t.Fatalf("failed post proclaim request (%s) (%v)", cx.apiPrefix, err)
}
Expand All @@ -359,7 +364,12 @@ func testV3CurlResignMissiongLeaderKey(cx ctlCtx) {
if err := cURLPost(cx.epc, cURLReq{
endpoint: path.Join(cx.apiPrefix, "/election/resign"),
value: `{}`,
expected: `{"error":"\"leader\" field must be provided","message":"\"leader\" field must be provided","code":2}`,
// NOTE: The order of json fields is aligned with the runtime.errorBody
//
// REF:
// 1. https://github.com/grpc-ecosystem/grpc-gateway/blob/v1.11.0/runtime/errors.go#L73
// 2. https://github.com/grpc/grpc/blob/master/src/proto/grpc/status/status.proto#L82
expected: `{"error":"\"leader\" field must be provided","code":2,"message":"\"leader\" field must be provided"}`,
}); err != nil {
cx.t.Fatalf("failed post resign request (%s) (%v)", cx.apiPrefix, err)
}
Expand Down

0 comments on commit a577940

Please sign in to comment.