package state import ( "sync" "testing" pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" ) func TestBeaconState_SlotDataRace(t *testing.T) { headState, err := InitializeFromProto(&pb.BeaconState{Slot: 1}) if err != nil { t.Fatal(err) } wg := sync.WaitGroup{} wg.Add(2) go func() { if err := headState.SetSlot(uint64(0)); err != nil { t.Fatal(err) } wg.Done() }() go func() { headState.Slot() wg.Done() }() wg.Wait() }