-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add raft tests; backwards compatible time.Time #13
Conversation
We are concerned with binary backwards compatibility for this project, especially as the upstream has a history of making breaking changes. With that in mind, I collected a bunch of data from https://github.com/hashicorp/raft for v0.5.5, v1.1.5, and v1.1.6 of `go-msgpack` to ensure that, moving forward, we can always decode old raft logs. For the tests to pass, we have to support decoding `time.Time` using the `encoding/binary` marshalling format, which was used in certain v1.1.6. Also added in the `go.sum` file, which is needed to build with newer versions of Go.
I absolutely love this! This library has caused so much pain over the years just fixing this one issue that caused us to diverge is fantastic. I love the testing methodology too. I have a couple of suggestions that might make them cleaner to read and maintain:
Just som suggestions. the actual PR here looks awesome already! |
@banks excellent ideas! I'll work on simplifying the tests, and this is great excuse for me to learn the fuzzing framework in the latest versions of Go. :) |
Go's recent fuzzing improvement are awesome, but they probably won't help for this type of test yet as they can only fuzz a few simple types. |
@banks I moved all of the verbose test data to separate files in |
(I think I'll do fuzzing in a separate PR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have any of the historical context for this issue, but I've dug around to educate myself and this looks good to me AFAICT. The tests are great 👍
Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late to the party but looks great!
We are concerned with binary backwards compatibility for this project, especially as the upstream has a history of making breaking changes.
With that in mind, I collected a bunch of data from https://github.com/hashicorp/raft for v0.5.5, v1.1.5, and v1.1.6 of
go-msgpack
to ensure that, moving forward, we can always decode old raft logs.For the tests to pass, we have to support decoding
time.Time
using theencoding/binary
marshalling format, which was used in certain v1.1.6.Also added in the
go.sum
file, which is needed to build with newer versions of Go.