There was a goroutine started to log things upon a test that could be
ended at the time `cmd.Wait()` ends.
To solve the problem, when the sub-test ends, ensure we wait until the
command ends when ending the test
The output of `make test` before the fix shows:
```
=== RUN TestNewUDPLogListener
==================
WARNING: DATA RACE
Read at 0x00c0002a8643 by goroutine 74:
testing.(*common).logDepth()
/usr/local/go/src/testing/testing.go:629 +0x132
testing.(*common).Logf()
/usr/local/go/src/testing/testing.go:614 +0x90
k8s.io/ingress-nginx/internal/ingress/metric/collectors.TestProcessCollector.func1.1()
/go/src/k8s.io/ingress-nginx/internal/ingress/metric/collectors/process_test.go:54 +0x140
Previous write at 0x00c0002a8643 by goroutine 72:
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:856 +0x33e
testing.tRunner()
/usr/local/go/src/testing/testing.go:869 +0x17f
Goroutine 74 (running) created at:
k8s.io/ingress-nginx/internal/ingress/metric/collectors.TestProcessCollector.func1()
/go/src/k8s.io/ingress-nginx/internal/ingress/metric/collectors/process_test.go:50 +0x218
testing.tRunner()
/usr/local/go/src/testing/testing.go:865 +0x163
Goroutine 72 (finished) created at:
testing.(*T).Run()
/usr/local/go/src/testing/testing.go:916 +0x699
testing.runTests.func1()
/usr/local/go/src/testing/testing.go:1157 +0xa8
testing.tRunner()
/usr/local/go/src/testing/testing.go:865 +0x163
testing.runTests()
/usr/local/go/src/testing/testing.go:1155 +0x523
testing.(*M).Run()
/usr/local/go/src/testing/testing.go:1072 +0x2eb
main.main()
_testmain.go:52 +0x222
==================
--- PASS: TestNewUDPLogListener (0.00s)
```
after the patch:
```
=== RUN TestNewUDPLogListener
--- PASS: TestNewUDPLogListener (0.01s)
```
Change-Id: I8ea246d14f5f80b330be19dd5b8299c6762f6d6b
|
||
|---|---|---|
| .github | ||
| .travis | ||
| build | ||
| cmd | ||
| deploy | ||
| docs | ||
| hack | ||
| images | ||
| internal | ||
| rootfs | ||
| test | ||
| vendor | ||
| version | ||
| .codecov.yml | ||
| .dockerignore | ||
| .gitignore | ||
| .luacheckrc | ||
| .travis.yml | ||
| CONTRIBUTING.md | ||
| Changelog.md | ||
| Gopkg.lock | ||
| Gopkg.toml | ||
| LICENSE | ||
| Makefile | ||
| OWNERS | ||
| OWNERS_ALIASES | ||
| README.md | ||
| SECURITY_CONTACTS | ||
| code-of-conduct.md | ||
| labels.yaml | ||
| mkdocs.yml | ||
| requirements-docs.txt | ||
README.md
Help us to improve the NGINX Ingress controller completing the survey
NGINX Ingress Controller
Get Involved
- Contributing: Pull requests are welcome!
- Read
CONTRIBUTING.mdand check out help-wanted issues - Submit github issues for any feature enhancements, bugs or documentation problems
- Read
- Support: Join to Kubernetes Slack to ask questions to get support from the maintainers and other developers
- Questions/comments can also be posted as github issues
- Discuss: Tweet using the
#IngressNginxhashtag
Description
This repository contains the NGINX controller built around the Kubernetes Ingress resource that uses ConfigMap to store the NGINX configuration. Make Ingress-Nginx Work for you, and the Community from KubeCon Europe 2018 is a great video to get you started!!
Learn more about using Ingress on k8s.io
What is an Ingress Controller?
Configuring a webserver or loadbalancer is harder than it should be. Most webserver configuration files are very similar. There are some applications that have weird little quirks that tend to throw a wrench in things, but for the most part you can apply the same logic to them and achieve a desired result.
The Ingress resource embodies this idea, and an Ingress controller is meant to handle all the quirks associated with a specific "class" of Ingress.
An Ingress Controller is a daemon, deployed as a Kubernetes Pod, that watches the apiserver's /ingresses endpoint for updates to the Ingress resource. Its job is to satisfy requests for Ingresses.
Documentation
To check out Live Docs
Questions
For questions and support please use the #ingress-nginx channel in the Kubernetes Slack or post to the Kubernetes Forum. The issue list of this repo is exclusively for bug reports and feature requests.
Issues
Please make sure to read the Issue Reporting Checklist before opening an issue. Issues not conforming to the guidelines may be closed immediately.
Changelog
Detailed changes for each release are documented in the Changelog.md
Contribution
Please make sure to read the Contributing Guide before making a pull request.
Thank you to all the people who already contributed to NGINX Ingress Controller!
Code of Conduct
This project adheres to the Kubernetes Community Code of Conduct. By participating in this project you agree to abide by its terms.