diff --git a/codec/types/any_test.go b/codec/types/any_test.go index b9ddbe72ec3..94dd677fe0f 100644 --- a/codec/types/any_test.go +++ b/codec/types/any_test.go @@ -28,6 +28,9 @@ var eom = &errOnMarshal{} // Ensure that returning an error doesn't suddenly allocate and waste bytes. // See https://github.com/cosmos/cosmos-sdk/issues/8537 func TestNewAnyWithCustomTypeURLWithErrorNoAllocation(t *testing.T) { + // make sure we're not in the middle of a GC. + runtime.GC() + var ms1, ms2 runtime.MemStats runtime.ReadMemStats(&ms1) any, err := types.NewAnyWithValue(eom)