tests: fix TestNewAnyWithCustomTypeURLWithErrorNoAllocation failure (#11715)

This commit is contained in:
Julien Robert 2022-04-21 16:09:34 +02:00 committed by GitHub
parent c01b8253b3
commit f421b95000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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)