Skip to content

Commit

Permalink
Limit concurrency to prevent address bind failures in CICD.
Browse files Browse the repository at this point in the history
  • Loading branch information
hashi-derek committed Jan 22, 2024
1 parent 0d44238 commit 57de129
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
go-mod-${{ matrix.GO_VERSION }}
- name: "Unit tests"
run: |
go test ./...
go test -parallel=1 ./...
unit-tests-race:
name: "Unit Tests Race"
Expand Down
9 changes: 7 additions & 2 deletions testutil/addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ func TakeIP() (ip net.IP, returnFn func()) {
logf("took %s after %d attempts", ip, attempts)
}
return ip, func() {
ln.Close()
time.Sleep(50 * time.Millisecond) // let the kernel cool down
for i := 0; i < 10; i++ {
err := ln.Close()
time.Sleep(50 * time.Millisecond) // let the kernel cool down
if err == nil {
break
}
}
returnIP(ip)
}
}
Expand Down

0 comments on commit 57de129

Please sign in to comment.