prysm-pulse/beacon-chain/blockchain/service_norace_test.go
Victor Farazdagi deb025f57c
Applies assertion funcs to blockchain tests (#6605)
* applies assertion funcs to blockchain tests
* Merge branch 'master' into blockchain-apply-testutils-assertions
* gofmt
* Merge refs/heads/master into blockchain-apply-testutils-assertions
* Merge refs/heads/master into blockchain-apply-testutils-assertions
* Merge refs/heads/master into blockchain-apply-testutils-assertions
* Merge refs/heads/master into blockchain-apply-testutils-assertions
* Merge refs/heads/master into blockchain-apply-testutils-assertions
2020-07-16 12:11:39 +00:00

28 lines
580 B
Go

package blockchain
import (
"context"
"io/ioutil"
"testing"
testDB "github.com/prysmaticlabs/prysm/beacon-chain/db/testing"
"github.com/prysmaticlabs/prysm/shared/testutil/require"
"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)
s := &Service{
beaconDB: db,
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))
}()
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))
}