File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
java/src/org/openqa/selenium/net Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -35,11 +35,9 @@ public class PortProber {
35
35
public static final int START_OF_USER_PORTS = 1024 ;
36
36
private static final Random random = new Random ();
37
37
private static final EphemeralPortRangeDetector ephemeralRangeDetector ;
38
- private static final boolean inDocker = Boolean . parseBoolean ( System . getenv ( "SE_DOCKER" ) );
38
+ private static final Platform current = Platform . getCurrent ( );
39
39
40
40
static {
41
- final Platform current = Platform .getCurrent ();
42
-
43
41
if (current .is (Platform .LINUX )) {
44
42
ephemeralRangeDetector = LinuxEphemeralPortRangeDetector .getInstance ();
45
43
} else if (current .is (Platform .XP )) {
@@ -128,7 +126,7 @@ private static boolean isFree(String bindHost, int port) {
128
126
static int checkPortIsFree (int port ) {
129
127
boolean localhostIsFree = isFree ("localhost" , port );
130
128
// We cannot check against all interfaces if the Grid is running inside Docker.
131
- if (inDocker && localhostIsFree ) {
129
+ if (current . is ( Platform . LINUX ) && localhostIsFree ) {
132
130
return port ;
133
131
}
134
132
if (localhostIsFree && isFree ("0.0.0.0" , port ) && isFree ("::1" , port )) {
You can’t perform that action at this time.
0 commit comments