Autopkgtest failure attempting to test deprecated/removed api

Bug #1897179 reported by Bryce Harrington
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
golang-github-grpc-ecosystem-grpc-gateway (Ubuntu)
New
Undecided
Unassigned

Bug Description

golang-github-grpc-ecosystem-grpc-gateway started failing its autopkgtests when tested with golang-goprotobuf/1.4.2-0ubuntu1.

See https://autopkgtest.ubuntu.com/packages/g/golang-github-grpc-ecosystem-grpc-gateway/groovy/amd64

The specific failing test case output is:

--- FAIL: TestParseRequest (0.00s)
    --- FAIL: TestParseRequest/Empty_input_should_produce_empty_output (0.00s)
    --- PASS: TestParseRequest/Invalid_reader_should_produce_error (0.00s)
    --- PASS: TestParseRequest/Invalid_proto_message_should_produce_error (0.00s)
FAIL
FAIL github.com/grpc-ecosystem/grpc-gateway/codegenerator 0.034s
? github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway [no test files]
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
        A future release of golang/protobuf will delete this package,
        which has long been excluded from the compatibility promise.
--- PASS: TestAnnotateContext_SupportsCustomAnnotators (0.00s)
=== RUN TestDefaultHTTPError
--- FAIL: TestDefaultHTTPError (0.00s)
panic: mismatching field: got github_com.grpc_ecosystem.grpc_gateway.runtime.errorBody.error, want github_com.grpc_ecosystem.grpc_gateway.runtime.errorBody.message [recovered]
        panic: mismatching field: got github_com.grpc_ecosystem.grpc_gateway.runtime.errorBody.error, want github_com.grpc_ecosystem.grpc_gateway.runtime.errorBody.message
...
FAIL github.com/grpc-ecosystem/grpc-gateway/runtime 0.032s
? github.com/grpc-ecosystem/grpc-gateway/runtime/internal [no test files]

In decyphering what all that means, it's essentially just failing this one test case:

    import (
        ...
        "github.com/golang/protobuf/proto"
        plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
        "github.com/grpc-ecosystem/grpc-gateway/codegenerator"
    )

    var parseReqTests = []struct {
            name string
            in io.Reader
            out *plugin.CodeGeneratorRequest
            err error
    }{
            {
                    "Empty input should produce empty output",
                    mustGetReader(&plugin.CodeGeneratorRequest{}),
                    &plugin.CodeGeneratorRequest{},
                    nil,
            },

Which is just a "" == "" sanity check test case.

The warning up above is triggered by the init of protoc-gen-go/generator by this test case, and it suggests that protoc-gen-go/generator's API does not have a stability guarantee and is deprecated for removal. My guess is that our change from golang-goprotobuf 1.3.x (currently in groovy) to golang-goprotobuf 1.4.x (currently in groovy-proposed) involves (at least) a behavioral change in this particular API that is triggering this test failure.

Our golang-github-grpc-ecosystem-grpc-gateway 1.6.4 is far behind upstream. They dropped their use of protoc-gen-go/generator with their v1.14.5 release (See https://github.com/grpc-ecosystem/grpc-gateway/issues/1209, https://github.com/grpc-ecosystem/grpc-gateway/pull/1260, and https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v1.14.5) although I notice they did not update this particular test case.

My guess is we can simply disable the test for now, so as to at least unblock golang-goprotobuf.

Tags: patch
Revision history for this message
Bryce Harrington (bryce) wrote :

The "panic: mismatching field" error for TestDefaultHTTPError appears to be a second, unrelated error, raised with Debian:

https://<email address hidden>/msg08294.html

like the other issue, it is likely resolved with a newer version of golang-github-grpc-ecosystem-grpc-gateway

Revision history for this message
Bryce Harrington (bryce) wrote :

This patch disables the test case broken by golang-goprotobuf 1.4's API change. Testing it locally shows it resolves the test failure.

Revision history for this message
Bryce Harrington (bryce) wrote :

The second error, regarding the panic about message/error mixup, is this upstream issue:

https://github.com/grpc-ecosystem/grpc-gateway/pull/1016

The patch didn't apply cleanly to the 1.6.4 tree but it's trivial to backport manually.

Unfortunately, while it did eliminate the panic, it unfortunately then unblocked a bunch more test cases to be able to run, several of which had their own failures:

    marshal_jsonpb_test.go:114: case 4: got = single_nested:<> uuid:"6EC2446F-7E89-4127-B3E6-5C05E6BECBA7" nested:<name:"foo" amount:12345 > uint64_value:18446744073709551615 enum_value:ONE oneof_string:"bar" map_value:<key:"a" value:ONE > map_value:<key:"b" value:ZERO > timestamp_value:<> ; want single_nested:<> uuid:"6EC2446F-7E89-4127-B3E6-5C05E6BECBA7" nested:<name:"foo" amount:12345 > uint64_value:18446744073709551615 enum_value:ONE oneof_string:"bar" map_value:<key:"a" value:ONE > map_value:<key:"b" value:ZERO > timestamp_value:<> ; spec={false false true 0x97b170}
--- FAIL: TestJSONPbMarshal (0.00s)

    marshal_jsonpb_test.go:232: dest = &wrapperspb.UInt64Value{state:impl.MessageState{NoUnkeyedLiterals:pragma.NoUnkeyedLiterals{}, DoNotCompare:pragma.DoNotCompare{}, DoNotCopy:pragma.DoNotCopy{}, atomicMessageInfo:(*impl.MessageInfo)(0xc0001a03a8)}, sizeCache:0, unknownFields:[]uint8(nil), Value:0x7b}; want &wrapperspb.UInt64Value{state:impl.MessageState{NoUnkeyedLiterals:pragma.NoUnkeyedLiterals{}, DoNotCompare:pragma.DoNotCompare{}, DoNotCopy:pragma.DoNotCopy{}, atomicMessageInfo:(*impl.MessageInfo)(nil)}, sizeCache:0, unknownFields:[]uint8(nil), Value:0x7b}; input = "123"
--- FAIL: TestJSONPbUnmarshalFields (0.00s)

=== RUN TestPopulateParameters
--- FAIL: TestPopulateParameters (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
 panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb0 pc=0x7bdda7]

I'm guessing there are also upstream fixes for those, but am becoming convinced that Balint is right and efforts would be better targeted to merge a newer version of the package.

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.