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

Test failing for 'internal/task' package #2198

Closed
antoineco opened this issue Mar 13, 2018 · 0 comments · Fixed by #2209
Closed

Test failing for 'internal/task' package #2198

antoineco opened this issue Mar 13, 2018 · 0 comments · Fixed by #2209
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@antoineco
Copy link
Contributor

antoineco commented Mar 13, 2018

Is this a BUG REPORT or FEATURE REQUEST?: Bug report
NGINX Ingress controller version: master
Kubernetes version: none
Environment: Linux 4.9.65-3+deb9u2, Debian stretch (container), Go 1.10

What happened:

I noticed the following test failed consistently in my CI environment (Jenkins w/ container step) when invoking go test -race -cover $(PKG)/internal/...:

E0313 18:17:50.185305    9583 queue.go:65] queue has been shutdown, failed to enqueue: {testKey testValue}
E0313 18:17:50.200777    9583 queue.go:73] failed to get key
--- FAIL: TestSkipEnqueue (0.01s)
	queue_test.go:154: sr should be 1, but is 2
FAIL
coverage: 84.8% of statements
FAIL	k8s.io/ingress-nginx/internal/task	0.353s

I can't reproduce locally. There is definitely something wrong with the execution environment but I need more time to investigate.

What you expected to happen:

All tests pass.

How to reproduce it:

Jenkinsfile:

def goPackage = 'k8s.io/ingress-nginx'

ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/src/${goPackage}") {
	withEnv(["GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}", 'GOCACHE=/tmp/.gocache']) {

	docker.image('golang:1.10').inside {
		stage('Build'){
			sh 'CGO_ENABLED=0 go build -ldflags "-s -w" k8s.io/ingress-nginx/cmd/nginx'
		}
		stage('Test'){
			sh 'go test -race -cover k8s.io/ingress-nginx/internal/...'
		}
	}
}}

Equivalent:

$ docker run --name tests -t -d -u 9007:9007 --rm \
    -e GOCACHE=/tmp/.gocache \
    -v $(pwd):/go/src/k8s.io/ingress-nginx golang:1.10 \
    cat
$ docker exec tests \
    sh -c 'CGO_ENABLED=0 go build -ldflags "-s -w" k8s.io/ingress-nginx/cmd/nginx'
$ docker exec tests \
    sh -c 'go test -race -cover k8s.io/ingress-nginx/internal/...'
$ docker stop tests
@aledbf aledbf added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. labels Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants