Skip to content

Migrate remaining grid management functionality from Selenium-Foundation

Choose a tag to compare

@sbabcoc sbabcoc released this 18 Jul 05:25
· 65 commits to main since this release

selenium-grid-manager 36.0.0 Release Notes

Breaking Changes

Removed APIs

  • ServerProcessKiller — shutdown now handled by sidecar infrastructure
  • LocalSeleniumGrid.LocalGridServer nested class — promoted to top-level LocalGridServer class; references must be updated
  • IGridServerFactory registration in GridManagerPluginImpl
  • AbstractAppiumPlugin.appiumWithPM2() — PM2 is now unconditionally required for Appium
  • ServletContainer.main(), getDependencyContexts(), getServletArgs()ServletContainer is now a pure utility class
  • ServletFlags — no longer needed

Changed APIs

  • ManagedDriverPlugin.create()int hubPort parameter added
  • AppiumGridServer — promoted from nested class to top-level class in core package
  • LocalGridServer — promoted from nested class to top-level class in core package
  • CommandLine-based process launching replaced with ProcessBuilder throughout
  • AbstractAppiumPlugin refactored — shared logic extracted to AppiumPluginBase; findNPMBinary() and findPM2Binary() moved to NodeBinaryFinder

Moved Assets

  • Hub/node configuration templates moved from selenium-foundation to selenium-grid-manager resources
  • FoundationSlotMatcher moved from selenium-foundation to selenium-grid-manager
  • GridConfigFactory / GridConfigFactoryImpl — config file generation moved from selenium-foundation

New Features

Sidecar Servlet Infrastructure

A complete lifecycle management and monitoring solution for local Selenium Grid instances:

  • SidecarManager — starts and manages the sidecar servlet container; automatically launched when a local Grid collection is created
  • SidecarClient — HTTP client for communicating with the sidecar registration and shutdown endpoints
  • SidecarDashboard — standalone dashboard entry point; launched via ./gradlew runSidecar
  • Management console — available at http://localhost:9001/grid/control/console; displays managed and discovered Grid instances with shutdown controls, scan progress, and example site link

Sidecar Servlets

Servlet Endpoint Description
RegistrationServlet POST /grid/control/register Registers a Grid server with the sidecar
DeregistrationServlet POST /grid/control/deregister Removes a Grid collection from the registry
ShutdownServlet POST /grid/control/shutdown Shuts down a managed Grid collection
StopServlet POST /grid/control/stop Shuts down all managed collections and stops the sidecar
StatusServlet GET /grid/control/status Returns JSON status of all managed and discovered instances
ConsoleServlet GET /grid/control/console Serves the HTML management console

Shutdown Strategies

Shutdown is now handled by the sidecar using the appropriate strategy for each server type:

  • LifecycleShutdownStrategy — Selenium 3 hub and node servers via LifecycleServlet GET
  • PM2ShutdownStrategy — Appium servers via pm2 delete appium-<port>
  • PidShutdownStrategy — Selenium 4 servers via ProcessHandle.destroy() (S4) or command-line kill/taskkill (S3)

Auth Strategies

  • TokenSessionAuthStrategy — token + session cookie authentication for browser clients
  • OsUserAuthStrategy — OS user identity authentication for CLI clients (S4 only; S3 logs a warning)
  • DefaultSidecarAuthStrategy — chains both strategies

Grid Registry

  • GridRegistry — central registry for all managed Grid server registrations, grouped by hub port; owns the background scanner
  • GridInstanceScanner — background scanner that discovers unmanaged Grid instances by probing a configurable port range in time-limited chunks; supports fine-toothed (step=1) scanning on demand

Port Allocation

  • GridPortAllocationStrategy — interface for hub port allocation
  • DefaultGridPortAllocationStrategy — allocates port bundles (hub, pub, sub) using simultaneous ServerSocket reservation
  • GridHubPortAllocator — static facade; resolves strategy via GRID_PORT_ALLOCATOR setting at class load time

Configuration File Generation

  • GridConfigFactory — interface for version-specific Grid configuration file generation
  • GridConfigFactoryImpl (S3/S4) — version-specific implementations; call sites use GridConfigFactoryImpl.INSTANCE

Additional Improvements

  • ProxyListServlet — Selenium 3 hub servlet providing programmatic JSON node enumeration; added to hub config unconditionally as the hub-side counterpart to LifecycleServlet on nodes
  • AppiumGridServer.isActive() — uses /status endpoint for Appium 2.x compatibility
  • LocalSeleniumGrid.isActive() — override checks all node servers, not just the hub
  • Example page site — now hosted by the sidecar for both Selenium 3 and Selenium 4, eliminating version-specific hosting behavior and hardcoded port conflicts
  • JVM shutdown hook — registered in SidecarManager.ensureRunning() to call GridRegistry.shutdownAll() on JVM exit, ensuring clean cleanup even when tests fail catastrophically
  • SidecarSupportServiceLoader-based interface for version-specific Jetty servlet container lifecycle management