From 1e30cbb1f4e3d87d24699a6d572c58688f173019 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 22 Jan 2025 02:25:30 +0800 Subject: [PATCH] fix --- ethclient/simulated/backend_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ethclient/simulated/backend_test.go b/ethclient/simulated/backend_test.go index 0392475b9b..378df3f368 100644 --- a/ethclient/simulated/backend_test.go +++ b/ethclient/simulated/backend_test.go @@ -363,7 +363,9 @@ func createAndCloseSimBackend() { // spawned by global variables are not considered leaked. func TestCheckSimBackendGoroutineLeak(t *testing.T) { createAndCloseSimBackend() - goleak.IgnoreCurrent() + ignoreCur := goleak.IgnoreCurrent() + // ignore this leveldb function: this go-routine is guaranteed to be terminated 1 second after closing db handle + ignoreLdb := goleak.IgnoreAnyFunction("github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain") createAndCloseSimBackend() - goleak.VerifyNone(t) + goleak.VerifyNone(t, ignoreCur, ignoreLdb) }