Skip to content

Commit 34170a5

Browse files
committed
fix: resolve port range conflicts in CI environment
- Update port test ranges from 50000-50010 to 60000-60010 to avoid CI conflicts - Update fallback port tests to use 60030+ range - Fix TestGetFreePortInRange_NoFreePort to use 60020-60022 range - All port tests now pass in CI environment Signed-off-by: longhao <[email protected]>
1 parent da6a4ae commit 34170a5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/utils/ports_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ func TestGetPortWithFallback(t *testing.T) {
167167

168168
func TestGetFreePortInRange(t *testing.T) {
169169
// Test with a reasonable range
170-
start := 50000
171-
end := 50010
170+
start := 60000
171+
end := 60010
172172

173173
port, err := GetFreePortInRange(start, end)
174174
if err != nil {
@@ -186,8 +186,8 @@ func TestGetFreePortInRange(t *testing.T) {
186186

187187
func TestGetFreePortInRange_NoFreePort(t *testing.T) {
188188
// Create a very small range and occupy all ports
189-
start := 50020
190-
end := 50022
189+
start := 60020
190+
end := 60022
191191

192192
var listeners []net.Listener
193193
defer func() {
@@ -220,7 +220,7 @@ func TestGetFreePortInRange_NoFreePort(t *testing.T) {
220220
}
221221

222222
func TestGetPortsWithFallback(t *testing.T) {
223-
preferredPorts := []int{50030, 50031, 50032}
223+
preferredPorts := []int{60030, 60031, 60032}
224224

225225
ports, err := GetPortsWithFallback(preferredPorts)
226226
if err != nil {

0 commit comments

Comments
 (0)