mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 11:32:09 +00:00
Block networking in sandbox test by default, fix roughtime panic (#3240)
* block networking in sandbox test by default, fix roughtime panic * Update .bazelrc
This commit is contained in:
parent
6ac0d12f5b
commit
e88bbaf614
5
.bazelrc
5
.bazelrc
@ -8,3 +8,8 @@ test --build_tests_only
|
|||||||
build --host_force_python=PY2
|
build --host_force_python=PY2
|
||||||
test --host_force_python=PY2
|
test --host_force_python=PY2
|
||||||
run --host_force_python=PY2
|
run --host_force_python=PY2
|
||||||
|
|
||||||
|
# Networking is blocked for tests by default, add "requires-network" tag to your test if networking
|
||||||
|
# is required within the sandbox. This flag is no longer experimental after 0.29.0.
|
||||||
|
# Network sandboxing only works on linux.
|
||||||
|
--experimental_sandbox_default_allow_network=false
|
||||||
|
@ -7,6 +7,7 @@ go_library(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"@com_github_cloudflare_roughtime//:go_default_library",
|
"@com_github_cloudflare_roughtime//:go_default_library",
|
||||||
|
"@com_github_sirupsen_logrus//:go_default_library",
|
||||||
"@com_googlesource_roughtime_roughtime_git//go/config:go_default_library",
|
"@com_googlesource_roughtime_roughtime_git//go/config:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
rt "github.com/cloudflare/roughtime"
|
rt "github.com/cloudflare/roughtime"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
"roughtime.googlesource.com/roughtime.git/go/config"
|
"roughtime.googlesource.com/roughtime.git/go/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,6 +23,8 @@ func mustDecodeString(in string) []byte {
|
|||||||
return pk
|
return pk
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var log = logrus.WithField("prefix", "roughtime")
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
t0 := time.Now()
|
t0 := time.Now()
|
||||||
|
|
||||||
@ -71,7 +74,7 @@ func init() {
|
|||||||
var err error
|
var err error
|
||||||
offset, err = rt.AvgDeltaWithRadiusThresh(results, t0, 2*time.Second)
|
offset, err = rt.AvgDeltaWithRadiusThresh(results, t0, 2*time.Second)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
log.WithError(err).Error("Failed to calculate roughtime offset")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user