mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-28 14:17:17 +00:00
37cba662f1
* toggle flags * Merge branch 'master' of github.com:prysmaticlabs/prysm * Merge branch 'master' of github.com:prysmaticlabs/prysm * run gofmt * Merge branch 'master' into lint-repo
32 lines
597 B
Go
32 lines
597 B
Go
package blockchain
|
|
|
|
import (
|
|
"context"
|
|
"io/ioutil"
|
|
"testing"
|
|
|
|
testDB "github.com/prysmaticlabs/prysm/beacon-chain/db/testing"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func init() {
|
|
logrus.SetLevel(logrus.DebugLevel)
|
|
logrus.SetOutput(ioutil.Discard)
|
|
}
|
|
|
|
func TestChainService_SaveHead_DataRace(t *testing.T) {
|
|
db := testDB.SetupDB(t)
|
|
defer testDB.TeardownDB(t, db)
|
|
s := &Service{
|
|
beaconDB: db,
|
|
}
|
|
go func() {
|
|
if err := s.saveHead(context.Background(), [32]byte{}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}()
|
|
if err := s.saveHead(context.Background(), [32]byte{}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|