From f421b9500014ec9338662a18357f096a1fd73b4e Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 21 Apr 2022 16:09:34 +0200 Subject: [PATCH] tests: fix TestNewAnyWithCustomTypeURLWithErrorNoAllocation failure (#11715) --- codec/types/any_test.go | 3 +++ 1 file changed, 3 insertions(+) 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)