This commit is contained in:
nisdas
2022-08-03 22:04:15 +08:00
parent 52d200df35
commit 1a3c60ad41

View File

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