Skip to content

Commit

Permalink
[Fix] The most recent changes to golang/protobuf breaks the spew Circ…
Browse files Browse the repository at this point in the history
…ular data structure detection

The latest update to golang/protobuf (I am on v1.4.2) break the spew circular data structure detection. This means that when calling `assert.Equal(t, proto1, proto2)` will not only fail, but also enter an infinite recursion.

Given spew is not being actively maintained, and tesitfy should set some upper bound, we need to set a `MaxDepth` to some very high number, so at least the test will not run for a very long time and finish and fail quickly.
  • Loading branch information
Graham Jenson authored and boyan-soubachov committed Nov 3, 2020
1 parent dc8af72 commit 8fb4b24
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions assert/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,7 @@ var spewConfig = spew.ConfigState{
DisableCapacities: true,
SortKeys: true,
DisableMethods: true,
MaxDepth: 100,
}

type tHelper interface {
Expand Down

0 comments on commit 8fb4b24

Please sign in to comment.