Skip to content

Commit 160efcb

Browse files
authored
Merge pull request #1913 from k8s-infra-cherrypick-robot/cherry-pick-1910-to-release-0.12
🐛 Fix issue with starting multiple test envs
2 parents 1efdbd7 + 6c84577 commit 160efcb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/internal/testing/addr/manager.go

+10
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,20 @@ func (c *portCache) add(port int) (bool, error) {
7171
}
7272
info, err := d.Info()
7373
if err != nil {
74+
// No-op if file no longer exists; may have been deleted by another
75+
// process/thread trying to allocate ports.
76+
if errors.Is(err, fs.ErrNotExist) {
77+
return nil
78+
}
7479
return err
7580
}
7681
if time.Since(info.ModTime()) > portReserveTime {
7782
if err := os.Remove(filepath.Join(cacheDir, path)); err != nil {
83+
// No-op if file no longer exists; may have been deleted by another
84+
// process/thread trying to allocate ports.
85+
if os.IsNotExist(err) {
86+
return nil
87+
}
7888
return err
7989
}
8090
}

0 commit comments

Comments
 (0)