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:
Preston Van Loon
2019-08-19 12:13:05 -04:00
committed by GitHub
parent 6ac0d12f5b
commit e88bbaf614
3 changed files with 10 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"@com_github_cloudflare_roughtime//:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@com_googlesource_roughtime_roughtime_git//go/config:go_default_library",
],
)

View File

@@ -6,6 +6,7 @@ import (
"time"
rt "github.com/cloudflare/roughtime"
"github.com/sirupsen/logrus"
"roughtime.googlesource.com/roughtime.git/go/config"
)
@@ -22,6 +23,8 @@ func mustDecodeString(in string) []byte {
return pk
}
var log = logrus.WithField("prefix", "roughtime")
func init() {
t0 := time.Now()
@@ -71,7 +74,7 @@ func init() {
var err error
offset, err = rt.AvgDeltaWithRadiusThresh(results, t0, 2*time.Second)
if err != nil {
panic(err)
log.WithError(err).Error("Failed to calculate roughtime offset")
}
}