Skip to content

Commit 8fb4b24

Browse files
Graham Jensonboyan-soubachov
Graham Jenson
authored andcommitted
[Fix] The most recent changes to golang/protobuf breaks the spew Circular 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.
1 parent dc8af72 commit 8fb4b24

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

assert/assertions.go

+1
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,7 @@ var spewConfig = spew.ConfigState{
16221622
DisableCapacities: true,
16231623
SortKeys: true,
16241624
DisableMethods: true,
1625+
MaxDepth: 100,
16251626
}
16261627

16271628
type tHelper interface {

0 commit comments

Comments
 (0)