Kong / Kong/kubernetes-testing-framework
Using default nodePort in tests in unreliable because it might already be occupied on CI
- Dominant language
- Go
- Stars
- 44
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
### Problem statement
Using a concrete, default `nodePort`: https://github.com/Kong/kubernetes-testing-framework/blob/238e12e74d32e8692fcae1435b45fd8490f70ac9/pkg/clusters/addons/kong/addon.go#L540 proves to be unreliable in tests, especially in CI since we don't have full control over the environment and sometimes the port can be already occupied e.g. https://github.com/Kong/kubernetes-testing-framework/actions/runs/5022546754/jobs/9006138317#step:8:144 which fails the test.
### Proposed solution
Use something like `github.com/phayes/freeport` which allows finding a free port and use that in tests.
Contributor guide
Research direction
Start at pkg/clusters/addons/kong/addon.go around line 540 and inspect the tests that use the concrete default nodePort. Evaluate the proposed free-port approach, then run the affected integration tests; done means they no longer fail when that port is already occupied in CI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- ci-cd, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100