Skip to content

Commit

Permalink
[grid] Using random port for SessionQueueGridTest [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
diemol committed Nov 15, 2020
1 parent ea97f91 commit b1beaa0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,6 @@ private void saveSessionCapabilities(Capabilities sessionRequestCapabilities, Pa
} catch (IOException e) {
LOG.log(Level.WARNING,
"Failed to save session capabilities as metadata", e);
e.printStackTrace();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package org.openqa.selenium.grid.node.config;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.assertj.core.api.Condition;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -56,7 +54,6 @@
import static java.util.Collections.emptySet;
import static java.util.Collections.singletonMap;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.spy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
import org.openqa.selenium.grid.testing.TestSessionFactory;
import org.openqa.selenium.grid.web.CombinedHandler;
import org.openqa.selenium.grid.web.RoutableHttpClientFactory;
import org.openqa.selenium.net.PortProber;
import org.openqa.selenium.netty.server.NettyServer;
import org.openqa.selenium.remote.http.HttpClient;
import org.openqa.selenium.remote.http.HttpHandler;
Expand Down Expand Up @@ -232,7 +233,8 @@ public void stopServer() {
private static Server<?> createServer(HttpHandler handler) {
return new NettyServer(
new BaseServerOptions(
new MapConfig(ImmutableMap.of("server", ImmutableMap.of("port", 4444)))),
new MapConfig(
ImmutableMap.of("server", ImmutableMap.of("port", PortProber.findFreePort())))),
handler);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Optional<ActiveSession> apply(CreateSessionRequest sessionRequest) {
SessionId id = new SessionId(UUID.randomUUID());
Session session = sessionGenerator.apply(id, sessionRequest.getCapabilities());

URL url = null;
URL url;
try {
url = session.getUri().toURL();
} catch (MalformedURLException e) {
Expand Down

0 comments on commit b1beaa0

Please sign in to comment.