-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🚀 Feature]: Selenium 4 Grid Slot Matching RFC #15481
Comments
@sbabcoc, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
Wait, how do we match on If we filter out I don't like the idea of artificially declaring some values to be identity and some to be configuration. It's an arbitrary distinction that isn't in the spec. I'd like to go the other direction and not treat any capabilities as special. Everything that I know of implements My question is: why do we need to treat any of these keys as special if the user isn't going to manually put them the stereotype? Is there some place where a more complicated stereotype is automatically generated? |
@titusfortner The check for As stated in this RFC, the purpose of capability differentiation is to enable vendors to decide which capabilities should be considered for slot matching, and which should be passed on to selected end nodes without analysis. This is currently only possible via custom slot matchers, which are mutually exclusive per hub. Another possible mechanism to enable vendor-specific behavior would be to add another method to WebDriverInfo to enable vendors to extend or override the matching performed by DefaultSlotMatcher. Regarding the concept of formally defining two distinct capability categories versus how things are defined in the specification, I'm unaware of any detailed specifications for Selenium Grid, let alone the esoteric details of slot matching. As such, the implementation is the spec. The W3C WebDriver spec provides a lot of wiggle room regarding the handling of extension capabilities. It even presents the option of defining routing-specific capabilities to control how intermediate nodes match "new session" requests with compatible end nodes. This feature could potentially introduce an additional capability category (routing options), but I don't think this is strictly necessary. |
I know I'm trying to understand why the existing implementation is like that. (and we probably need to wait until after the conference for the Grid experts to have time to answer) 😄 |
Selenium 4 Grid Slot Matching RFC
Background
A core feature of Selenium 4 Grid is slot matching – the process of pairing a client “new session” request with a node that can satisfy the request. This process involves evaluating the client’s desired capabilities against the stereotypes of available nodes to determine which (if any) matches the request. The default implementation is defined in a class named DefaultSlotMatcher.
Implementation Details of DefaultSlotMatcher
platformName
capabilityplatformVersion
capability:platformVersion
goog:
,moz:
,ms:
, orse:
browserName
capability:browserName
value is undefined or emptybrowserName
capability has the desired valuebrowserVersion
capability:browserVersion
value is undefined, empty, or “stable”browserVersion
platformName
capability:platformName
value is undefinedplatformName
capability has the desired valueplatformName
Current Issue – Extension Capability Handling
As currently implemented, DefaultSlotMatcher has one obvious issue at Step 4 in its handling of extension capabilities. It ignores the extension capabilities of three vendors (Google, Mozilla, and Microsoft), but considers the extension capabilities of every other vendor (including Appium and Apple). This produces inconsistent slot matching behavior, with Appium extension capabilities causing slot matching to fail while similar Google extension capabilities would have no ill effect.
Solution – Capability Type Differentiation
The existing handling of extension capabilities for the three “special” vendors suggests that capabilities might be divided into two distinct categories: “identity” values that are considered for slot matching and configuration options that are transmitted to the matched node without analysis.
Patterns from Current Usage
In current usage, values defined within “options” extension capability objects should be ignored for slot matching (i.e. – configuration options). Two additional extension capabilities are also currently ignored:
<prefix>:debuggerAddress
and<prefix>:loggingPrefs
. Every other defined capability for the three “special” vendors is treated as an “identity” value. However, these categories are merely incidental, not formally defined within the specifications. Consequently, there’s no defined mechanism for vendors to add new “identity” values or configuration options.Proposal: Formally Define Capability Type Differentiation
Formalizing the current implied categorization of capabilities into “identity” values and configuration options will provide two distinct benefits:
Definition of configuration options
The proposed definition for configuration options, which will be ignored for purposes of slot matching:
options
Options
loggingPrefs
debuggerAddress
Definition of “identity” values
All capabilities that don’t conform with the definition of configuration options as defined above will be treated as “identity” values, which will be considered for purposes of slot matching. This includes extension capabilities with “special” prefixes that would previously have been ignored. This change is merely academic, though, given that there are no currently defined “special” extension capabilities that are affected by the revised behavior.
Usage example
This feature will be implemented in DefaultSlotMatcher. Consequently, anyone using Selenium 4 Grid without explicitly configuring a custom slot matcher will encounter the revised behavior.
The text was updated successfully, but these errors were encountered: