Skip to content

Commit

Permalink
[java] improve memory allocation of an idle relay node #13643
Browse files Browse the repository at this point in the history
  • Loading branch information
joerg1985 committed Mar 3, 2024
1 parent d65e38e commit 5bc8952
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Optional;
import java.util.logging.Logger;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.ImmutableCapabilities;
import org.openqa.selenium.grid.config.Config;
import org.openqa.selenium.grid.config.ConfigException;
import org.openqa.selenium.grid.node.SessionFactory;
Expand Down Expand Up @@ -149,18 +150,19 @@ public Map<Capabilities, Collection<SessionFactory>> getSessionFactories(
LOG.info(String.format("Adding relay configs for %s", getServiceUri()));
parsedConfigs.forEach(
(maxSessions, stereotype) -> {
ImmutableCapabilities immutable = new ImmutableCapabilities(stereotype);
for (int i = 0; i < maxSessions; i++) {
factories.put(
stereotype,
immutable,
new RelaySessionFactory(
tracer,
clientFactory,
sessionTimeout,
getServiceUri(),
getServiceStatusUri(),
stereotype));
immutable));
}
LOG.info(String.format("Mapping %s, %d times", stereotype, maxSessions));
LOG.info(String.format("Mapping %s, %d times", immutable, maxSessions));
});
return factories.build().asMap();
}
Expand Down

0 comments on commit 5bc8952

Please sign in to comment.