kubernetes: go test k8s.io/kubernetes/pkg/kubectl/cmd is failing on master
make test is failing on k8s.io/kubernetes/pkg/kubectl/cmd with go1.9.4, whereas the same package passes under bazel test.
go test shows failures like
--- FAIL: TestPodAndContainerAttach (0.05s)
attach_test.go:169: no container, no flags: unexpected error: No Auth Provider found for name "gcp"
attach_test.go:169: container in flag: unexpected error: No Auth Provider found for name "gcp"
attach_test.go:169: init container in flag: unexpected error: No Auth Provider found for name "gcp"
attach_test.go:169: no container, no flags, pods and name: unexpected error: No Auth Provider found for name "gcp"
attach_test.go:169: no container, no flags, pod/name: unexpected error: No Auth Provider found for name "gcp"
--- FAIL: TestAttach (0.00s)
attach_test.go:267: No Auth Provider found for name "gcp"
--- FAIL: TestAttachWarnings (0.00s)
attach_test.go:355: No Auth Provider found for name "gcp"
pod "pod0" deleted
pod "pod1" deleted
pod "pod2" deleted
pod "pod3" deleted
pod "pod4" deleted
pod "pod5" deleted
pod "pod6" deleted
pod "pod7" deleted
--- FAIL: TestPortForward (0.00s)
portforward_test.go:124: pod portforward: Unexpected error: No Auth Provider found for name "gcp"
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x15ae03c]
goroutine 351 [running]:
testing.tRunner.func1(0xc4209361e0)
[$HOME]/.gvm/gos/go1.9.4/src/testing/testing.go:711 +0x2d2
panic(0x17e1a20, 0x278b6e0)
[$HOME]/.gvm/gos/go1.9.4/src/runtime/panic.go:491 +0x283
k8s.io/kubernetes/pkg/kubectl/cmd.testPortForward(0xc4209361e0, 0x0, 0xc420c41590, 0x3, 0x3)
[$HOME]/code/kubernetes/src/k8s.io/kubernetes/pkg/kubectl/cmd/portforward_test.go:130 +0xcdc
k8s.io/kubernetes/pkg/kubectl/cmd.TestPortForward(0xc4209361e0)
[$HOME]/code/kubernetes/src/k8s.io/kubernetes/pkg/kubectl/cmd/portforward_test.go:140 +0x94
testing.tRunner(0xc4209361e0, 0x1a89958)
[$HOME]/.gvm/gos/go1.9.4/src/testing/testing.go:746 +0xd0
created by testing.(*T).Run
[$HOME]/.gvm/gos/go1.9.4/src/testing/testing.go:789 +0x2de
FAIL k8s.io/kubernetes/pkg/kubectl/cmd 16.572s
I dug into this a bit, and I think it started failing about two weeks ago, after https://github.com/kubernetes/kubernetes/pull/60218. Since CI only runs bazel test now, we didn’t notice the non-bazel go test failures.
It looks like the refactoring depends on init() effects from k8s.io/client-go/plugin/pkg/client/auth; if I add
import _ "k8s.io/client-go/plugin/pkg/client/auth"
to pkg/kubectl/cmd/attach_test.go, then the test passes under go test.
I’m not sure what bazel’s go rules are doing such that this effect is occurring without this explicit import. Still investigating…
(cc @jayconrod if you have any insight)
/sig testing
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 16 (15 by maintainers)
@BenTheElder to be clear, go1.9.3 and go1.10 fail in the same way.
This is getting more mysterious.
I added a panic to
staging/src/k8s.io/client-go/rest/plugin.go:bazel test still passes.
go testpanics as expected.something seems fishy.
@deads2k anything obviously wrong stand out to you here?