Skip to content

Commit

Permalink
Merge pull request #1913 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1910-to-release-0.12

🐛 Fix issue with starting multiple test envs
  • Loading branch information
k8s-ci-robot committed May 24, 2022
2 parents 1efdbd7 + 6c84577 commit 160efcb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/internal/testing/addr/manager.go
Expand Up @@ -71,10 +71,20 @@ func (c *portCache) add(port int) (bool, error) {
}
info, err := d.Info()
if err != nil {
// No-op if file no longer exists; may have been deleted by another
// process/thread trying to allocate ports.
if errors.Is(err, fs.ErrNotExist) {
return nil
}
return err
}
if time.Since(info.ModTime()) > portReserveTime {
if err := os.Remove(filepath.Join(cacheDir, path)); err != nil {
// No-op if file no longer exists; may have been deleted by another
// process/thread trying to allocate ports.
if os.IsNotExist(err) {
return nil
}
return err
}
}
Expand Down

0 comments on commit 160efcb

Please sign in to comment.