File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change
1
+ changelog :
2
+ - type : NON_USER_FACING
3
+ issueLink : https://github.com/solo-io/solo-projects/issues/7307
4
+ resolvesIssue : false
5
+ description : >-
6
+ Ensure that tests which are dynamically selecting ports always skip port 9095.
7
+ Due to recent changes, when Gloo is running, this port will always be used.
8
+ We choose to skip this, as it is the easiest way to avoid issues.
Original file line number Diff line number Diff line change @@ -75,7 +75,17 @@ func AdvancePort(p *uint32) uint32 {
75
75
// AdvancePortSafeListen returns a port that is safe to use in parallel tests
76
76
// It relies on pinging the port to see if it is in use
77
77
func AdvancePortSafeListen (p * uint32 , retryOptions ... retry.Option ) uint32 {
78
- return MustAdvancePortSafe (p , portInUseListen , retryOptions ... )
78
+ errIfPortInUse := func (proposedPort uint32 ) error {
79
+ if err := portInDenyList (proposedPort ); err != nil {
80
+ return err
81
+ }
82
+ if err := portInUseListen (proposedPort ); err != nil {
83
+ return err
84
+ }
85
+ return nil
86
+ }
87
+
88
+ return MustAdvancePortSafe (p , errIfPortInUse , retryOptions ... )
79
89
}
80
90
81
91
func portInUseListen (proposedPort uint32 ) error {
@@ -88,3 +98,16 @@ func portInUseListen(proposedPort uint32) error {
88
98
// Port should available if the listener closes without an error
89
99
return ln .Close ()
90
100
}
101
+
102
+ var denyListPorts = map [uint32 ]struct {}{
103
+ // See gloo/pkg/servers/admin/server.go
104
+ // See https://github.com/solo-io/solo-projects/issues/7307 for more details
105
+ 9095 : {},
106
+ }
107
+
108
+ func portInDenyList (proposedPort uint32 ) error {
109
+ if _ , ok := denyListPorts [proposedPort ]; ok {
110
+ return eris .Errorf ("port %d is in deny list" , proposedPort )
111
+ }
112
+ return nil
113
+ }
You can’t perform that action at this time.
0 commit comments