Descriptionidentityservice: out-of-random nil error
I was running the test suite on my VM, and I think I
rand out of entropy for a bit. It ended up that I got
a nil pointer dereference exception, which I traced
back to the randomHexToken code incorrectly handling
when it doesn't read enough bytes. (It isn't an error,
it just gets a count smaller than it expected.)
To make it testable, I ended up moving the direct
function call into a pointer that can be overridden.
I also discovered that Go-1.0+ doesn't allow you to compare
function pointers (in case a compiler wants to do
interesting optimizations). So I ended up doing a bit
of a workaround.
It was a longer side trip than I expected, but it did
get me exposed to gocheck.Checkers and some other
reasonable bits.
https://code.launchpad.net/~jameinel/goose/rand-failures/+merge/150751
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 6
Patch Set 2 : identityservice: out-of-random nil error #
Total comments: 10
Patch Set 3 : identityservice: out-of-random nil error #
Total comments: 2
Patch Set 4 : identityservice: out-of-random nil error #
MessagesTotal messages: 10
|