From 8fb4b2442e11c5a798920eb5a9c19dbc2603481b Mon Sep 17 00:00:00 2001 From: Graham Jenson Date: Thu, 22 Oct 2020 10:17:22 -0700 Subject: [PATCH] [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. --- assert/assertions.go | 1 + 1 file changed, 1 insertion(+) diff --git a/assert/assertions.go b/assert/assertions.go index 79340397a..68ed59949 100644 --- a/assert/assertions.go +++ b/assert/assertions.go @@ -1622,6 +1622,7 @@ var spewConfig = spew.ConfigState{ DisableCapacities: true, SortKeys: true, DisableMethods: true, + MaxDepth: 100, } type tHelper interface {