From 1a3c60ad41b76c651af2d64edff2eaf864ad64ec Mon Sep 17 00:00:00 2001 From: nisdas Date: Wed, 3 Aug 2022 22:04:15 +0800 Subject: [PATCH] lock it --- config/params/testutils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/params/testutils.go b/config/params/testutils.go index 7d437f0f92..959fff1b26 100644 --- a/config/params/testutils.go +++ b/config/params/testutils.go @@ -16,7 +16,11 @@ func SetupTestConfigCleanup(t testing.TB) { prevNetworkCfg := networkConfig.Copy() t.Cleanup(func() { mainnetBeaconConfig = prevDefaultBeaconConfig + // Lock the config, when cleaning up + // otherwise the race detector is triggered. + cfgrw.Lock() err = undo() + cfgrw.Unlock() if err != nil { t.Error(err) }