-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Running "make test" fails in random ways in TestValidatePorts on WSL #17268
Comments
/assign rmsilva1973 |
Will create a PR. Will wait a little bit for the opinions on the proposed alternatives (or any other additional considerations). |
/kind failing-test |
@spowelljr any considerations on this? 😁 |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What Happened?
Running "make test" on WSL fails with random ports on TestValidatePorts. Here are two samples:
--- FAIL: TestValidatePorts (0.00s)
--- FAIL: TestValidatePorts/0-1:80-81/udp (0.00s)
start_test.go:742: validatePorts(ports=[0-1:80-81/udp]): got Sorry, you cannot use privileged ports on the host (below 1024): 1, expected Sorry, one of the ports provided with --ports flag is outside range: 0
--- FAIL: TestValidatePorts (0.00s)
--- FAIL: TestValidatePorts/127.0.0.1:80-83:80-83/udp (0.00s)
start_test.go:742: validatePorts(ports=[127.0.0.1:80-83:80-83/udp]): got Sorry, you cannot use privileged ports on the host (below 1024): 83, expected Sorry, you cannot use privileged ports on the host (below 1024): 80
Tracking down the reason for this, I think it's due to the assumption that this loop on a map object returns the elements in an ordered way:
minikube/cmd/minikube/cmd/start.go
Lines 1359 to 1364 in 1b0d879
But apparently this doesn't seem to be true. Thus the test for ports "127.0.0.1:80-83:80-83/udp" like the example above returns an error validating a port different than 80 initially (83 in the specific run depicted above).
If my statement is correct, I have a proposal: add a "hasRegex" field to the structs inside the portTest array whose definition begins here:
minikube/cmd/minikube/cmd/start_test.go
Line 579 in 1b0d879
like this:
and then apply and validate the errorMsg using the regex when required. It seems better than assuming every errorMsg has regex since we'll be splattering escape characters all over them.
Another idea would be to search the first port and validate only that one. But this seems to be a rather lame way to handle it.
Attach the log file
Validation error samples:
--- FAIL: TestValidatePorts (0.00s)
--- FAIL: TestValidatePorts/0-1:80-81/udp (0.00s)
start_test.go:742: validatePorts(ports=[0-1:80-81/udp]): got Sorry, you cannot use privileged ports on the host (below 1024): 1, expected Sorry, one of the ports provided with --ports flag is outside range: 0
--- FAIL: TestValidatePorts (0.00s)
--- FAIL: TestValidatePorts/127.0.0.1:80-83:80-83/udp (0.00s)
start_test.go:742: validatePorts(ports=[127.0.0.1:80-83:80-83/udp]): got Sorry, you cannot use privileged ports on the host (below 1024): 83, expected Sorry, you cannot use privileged ports on the host (below 1024): 80
Operating System
Ubuntu
Driver
N/A
The text was updated successfully, but these errors were encountered: