Fix data races in tests accessing beacon config concurrently (#8190)

* add mutex to params/config

* split config files into test/prod

* add tags checker

* add regression test

* remove debug info

* update bazel config

* go fmt

* make sure that conditional file is kept by gazelle

* update build tag: test -> develop

* gazelle

* remove redundant import

* fix data race in TestService_ReceiveBlock
This commit is contained in:
Victor Farazdagi 2021-01-04 20:51:25 -08:00 committed by GitHub
parent f67f8dd6df
commit 318f83957a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -79,6 +79,7 @@ go_test(
srcs = [
"blockchain_test.go",
"chain_info_test.go",
"checktags_test.go",
"head_test.go",
"info_test.go",
"metrics_test.go",
@ -90,6 +91,7 @@ go_test(
"weak_subjectivity_checks_test.go",
],
embed = [":go_default_library"],
gotags = ["develop"],
deps = [
"//beacon-chain/blockchain/testing:go_default_library",
"//beacon-chain/cache/depositcache:go_default_library",
@ -126,6 +128,7 @@ go_test(
name = "go_raceon_test",
srcs = [
"chain_info_norace_test.go",
"checktags_test.go",
"receive_block_test.go",
"service_norace_test.go",
],
@ -137,6 +140,7 @@ go_test(
# See: https://github.com/etcd-io/bbolt/issues/187.
"-d=checkptr=0",
],
gotags = ["develop"],
race = "on",
tags = ["race_on"],
deps = [

View File

@ -0,0 +1,7 @@
// +build !develop
package blockchain
func init() {
log.Fatal("Tests in this package require extra build tag: re-run with `-tags develop`")
}