Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/yurthub/util/util_test.go:37:4: call to (*T).Fatalf from a non-test goroutine #248

Closed
advancedwebdeveloper opened this issue Apr 1, 2021 · 1 comment · Fixed by #269

Comments

@advancedwebdeveloper
Copy link

Hi.
Caught a bug:

$ make
go fmt ./pkg/... ./cmd/...
go fmt ./pkg/... ./cmd/...
go: downloading k8s.io/apimachinery v0.16.10-beta.0
go: downloading k8s.io/client-go v0.16.9
go: downloading github.com/kubernetes/kubernetes v1.16.9
go: downloading k8s.io/klog v1.0.0
go: downloading github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd
go: downloading k8s.io/api v0.16.9
go: downloading github.com/spf13/cobra v1.0.0
go: downloading k8s.io/apiserver v0.16.9
go: downloading google.golang.org/grpc v1.26.0
go: downloading sigs.k8s.io/apiserver-network-proxy v0.0.15
go: downloading github.com/prometheus/client_golang v0.9.2
go: downloading github.com/gorilla/mux v1.7.4
go: downloading k8s.io/component-base v0.16.9
go: downloading k8s.io/utils v0.0.0-20200603063816-c1c6865ac451
go: downloading k8s.io/cluster-bootstrap v0.16.9
go: downloading github.com/google/uuid v1.1.1
go: downloading k8s.io/klog/v2 v2.0.0
go: downloading github.com/go-logr/logr v0.1.0
go: downloading github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
go: downloading github.com/prometheus/common v0.0.0-20181126121408-4724e9255275
go: downloading github.com/prometheus/procfs v0.0.11
go: downloading sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15
go: downloading google.golang.org/protobuf v1.23.0
go: downloading google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55
go: downloading golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
go: downloading github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d
go: downloading golang.org/x/sys v0.0.0-20200519105757-fe76b779f299
go: downloading github.com/google/gofuzz v1.1.0
go: downloading github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
go: downloading github.com/docker/docker v17.12.0-ce-rc1.0.20200531234253-77e06fda0c94+incompatible
go: downloading github.com/emicklei/go-restful v2.12.0+incompatible
go: downloading github.com/pborman/uuid v1.2.0
go: downloading github.com/evanphx/json-patch v4.5.0+incompatible
go: downloading k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading sigs.k8s.io/structured-merge-diff v1.0.2
go: downloading github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
go: downloading github.com/go-openapi/spec v0.19.8
go: downloading github.com/blang/semver v3.5.0+incompatible
go: downloading github.com/coreos/etcd v3.3.17+incompatible
go: downloading github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
go: downloading github.com/hashicorp/golang-lru v0.5.4
go: downloading github.com/googleapis/gnostic v0.3.1
go: downloading github.com/pkg/errors v0.8.1
go: downloading golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975
go: downloading github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef
go: downloading golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1
go: downloading github.com/imdario/mergo v0.3.9
go: downloading github.com/go-openapi/jsonpointer v0.19.3
go: downloading github.com/go-openapi/jsonreference v0.19.2
go: downloading github.com/go-openapi/swag v0.19.5
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: downloading github.com/PuerkitoBio/purell v1.1.1
go: downloading github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: downloading github.com/NYTimes/gziphandler v1.1.1
go: downloading go.uber.org/zap v1.10.0
go: downloading github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
go: downloading go.uber.org/multierr v1.1.0
go: downloading go.uber.org/atomic v1.4.0
go: downloading k8s.io/apiextensions-apiserver v0.16.9
go: downloading github.com/godbus/dbus v4.1.0+incompatible
go: downloading gopkg.in/square/go-jose.v2 v2.5.1
go: downloading github.com/docker/distribution v2.7.1+incompatible
go: downloading github.com/opencontainers/go-digest v1.0.0
go vet ./pkg/... ./cmd/...

github.com/openyurtio/openyurt/pkg/yurthub/util

pkg/yurthub/util/util_test.go:37:4: call to (*T).Fatalf from a non-test goroutine
make: *** [Makefile:38: vet] Error 2
.

I am using

$ go version
go version go1.16.2 linux/arm64

@rambohe-ch
Copy link
Member

rambohe-ch commented Apr 1, 2021

Thank you for filing issue.
on my local desktop(go1.14.15 darwin/amd64), no error has happened. and in higher go version, in order to fix this bug, we may need to propagated the error back to main goroutine(func TestDualReader) and then call t.Fatalf with error in main goroutine.

@advancedwebdeveloper would you like to take over to fix this error and make a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants