tests fail with Go 1.5 tip #9

Closed
mwhudson opened this Issue Jul 27, 2015 · 2 comments

Comments

Projects
None yet
3 participants
mwhudson@glamdring:~$ go version
go version devel +0acecb7 Wed Jul 22 20:27:24 2015 +0000 linux/amd64
mwhudson@glamdring:~$ go test -v github.com/matttproud/golang_protobuf_extensions/pbutil
=== RUN   TestWriteDelimited
--- PASS: TestWriteDelimited (0.00s)
=== RUN   TestReadDelimited
--- PASS: TestReadDelimited (0.00s)
=== RUN   TestEndToEndValid
--- PASS: TestEndToEndValid (0.00s)
=== RUN   TestFuzz
--- FAIL: TestFuzz (0.00s)
panic: reflect: call of reflect.Value.NumField on zero Value [recovered]
    panic: reflect: call of reflect.Value.NumField on zero Value

goroutine 8 [running]:
testing.tRunner.func1(0xc8200a21b0)
    /opt/opensource/go/src/testing/testing.go:450 +0x171
reflect.flag.mustBe(0x0, 0x19)
    /opt/opensource/go/src/reflect/value.go:199 +0xa6
reflect.Value.NumField(0x0, 0x0, 0x0, 0x0)
    /opt/opensource/go/src/reflect/value.go:1146 +0x2a
github.com/matttproud/golang_protobuf_extensions/pbtest.sanitizeGenerated(0x7f92a0ca6ee8, 0x0, 0x1, 0x0, 0x0)
    /opt/opensource/gopath/src/github.com/matttproud/golang_protobuf_extensions/pbtest/quick.go:53 +0x2f8
github.com/matttproud/golang_protobuf_extensions/pbtest.sanitizeGenerated(0x7f92a0ca6e40, 0xc820033b00, 0x0, 0x0, 0x0)
    /opt/opensource/gopath/src/github.com/matttproud/golang_protobuf_extensions/pbtest/quick.go:64 +0x83e
github.com/matttproud/golang_protobuf_extensions/pbtest.SanitizeGenerated(0x7f92a0ca6e40, 0xc820033b00, 0x0, 0x0)
    /opt/opensource/gopath/src/github.com/matttproud/golang_protobuf_extensions/pbtest/quick.go:33 +0x40
github.com/matttproud/golang_protobuf_extensions/pbutil.rndMessage(0xc820011240, 0x0, 0x0)
    /opt/opensource/gopath/src/github.com/matttproud/golang_protobuf_extensions/pbutil/all_test.go:273 +0x3bd
github.com/matttproud/golang_protobuf_extensions/pbutil.rndMessages(0xc820011240, 0x0, 0x0, 0x0)
    /opt/opensource/gopath/src/github.com/matttproud/golang_protobuf_extensions/pbutil/all_test.go:284 +0xb7
github.com/matttproud/golang_protobuf_extensions/pbutil.TestFuzz.func1(0x0)
    /opt/opensource/gopath/src/github.com/matttproud/golang_protobuf_extensions/pbutil/all_test.go:292 +0x4a
reflect.Value.call(0x587e40, 0xc82000a9a0, 0x13, 0x60dca8, 0x4, 0x749988, 0x0, 0x0, 0x0, 0x0, ...)
    /opt/opensource/go/src/reflect/value.go:432 +0x120a
reflect.Value.Call(0x587e40, 0xc82000a9a0, 0x13, 0x749988, 0x0, 0x0, 0x0, 0x0, 0x0)
    /opt/opensource/go/src/reflect/value.go:300 +0xb1
testing/quick.Check(0x587e40, 0xc82000a9a0, 0x725e60, 0x0, 0x0)
    /opt/opensource/go/src/testing/quick/quick.go:270 +0x421
github.com/matttproud/golang_protobuf_extensions/pbutil.TestFuzz(0xc8200a21b0)
    /opt/opensource/gopath/src/github.com/matttproud/golang_protobuf_extensions/pbutil/all_test.go:317 +0x102
testing.tRunner(0xc8200a21b0, 0x723248)
    /opt/opensource/go/src/testing/testing.go:456 +0x98
created by testing.RunTests
    /opt/opensource/go/src/testing/testing.go:561 +0x86d

goroutine 1 [chan receive]:
testing.RunTests(0x66f140, 0x723200, 0x4, 0x4, 0x40ec01)
    /opt/opensource/go/src/testing/testing.go:562 +0x8ad
testing.(*M).Run(0xc820043ef8, 0x1b)
    /opt/opensource/go/src/testing/testing.go:494 +0x70
main.main()
    github.com/matttproud/golang_protobuf_extensions/pbutil/_test/_testmain.go:60 +0x116
exit status 2
FAIL    github.com/matttproud/golang_protobuf_extensions/pbutil 0.006s
mwhudson@glamdring:~$ 

I haven't checked but I'm 99% certain this is because testing/quick.Value can return a nil pointer now (see very bottom of http://tip.golang.org/doc/go1.5).

jjneely commented Oct 23, 2015

I'm hitting this too. Be great to have an update on this -- other than not run the tests.

Owner

matttproud commented Apr 23, 2016

Hi, @mwhudson and @jjneely, my apologies for not getting back to you earlier on this. I think the e-mail for this issue had slipped through the cracks of GMail's Priority Inbox. In any case, I have done a cursory investigation and discovered two faults:

  1. Nil pointer value generation in testing/quick is responsible for one round of anomalies. I introduced this capability into the upstream standard library testing/quick package when I noticed that it was a case not generated! The changelist was held in review for several weeks, and I lost track of the discrepancy between our HEAD and it.
  2. Protocol Buffers language level 3 introduces, I believe, API type changes that are incompatible with testing/quick's value generation semantics.

I like the blackbox tests, to be sure, but I am going to remove them for the time being. Nobody needs the noise. I may add them again later. The core reason I am not eager to fix them but rather delete is I want to offer a newer API that plays better with memory management semantics.

Mea culpa!

matttproud added a commit that referenced this issue Apr 23, 2016

pbtest: delete pkg because upstream IDL changes.
This commit deletes the blackbox end-to-end tests associated with
`testing/quick`, because several incompatible upstream changes broke
them, and it is difficult to tease apart where the fault lies for now.
It fixes #9.

The core of this is code is small and well tested.  At the very worst,
integrators can inform us quickly about breakages.

matttproud added a commit that referenced this issue Apr 23, 2016

pbtest: delete pkg because upstream IDL changes.
This commit deletes the blackbox end-to-end tests associated with
`testing/quick`, because several incompatible upstream changes broke
them, and it is difficult to tease apart where the fault lies for now.
It fixes #9.

The core of this is code is small and well tested.  At the very worst,
integrators can inform us quickly about breakages.

@matttproud matttproud closed this in #10 Apr 23, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment