mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-06 01:32:18 +00:00
26 lines
377 B
Go
26 lines
377 B
Go
|
package state
|
||
|
|
||
|
import (
|
||
|
"sync"
|
||
|
"testing"
|
||
|
|
||
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
||
|
)
|
||
|
|
||
|
func TestBeaconState_SlotDataRace(t *testing.T) {
|
||
|
headState, _ := InitializeFromProto(&pb.BeaconState{Slot: 1})
|
||
|
|
||
|
wg := sync.WaitGroup{}
|
||
|
wg.Add(2)
|
||
|
go func() {
|
||
|
headState.SetSlot(uint64(0))
|
||
|
wg.Done()
|
||
|
}()
|
||
|
go func() {
|
||
|
headState.Slot()
|
||
|
wg.Done()
|
||
|
}()
|
||
|
|
||
|
wg.Wait()
|
||
|
}
|