Skip to content

ScaledObject with a trigger whose metadata browserVersion is latest is always being triggered regardless of the browserVersion requested by the user #4347

Closed
@gifflet

Description

Report

ScaledObject with a trigger whose metadata browserVersion is latest is always being triggered regardless of the browserVersion requested by the user.

Considering that the following ScaledObjects have been defined with triggers in this way:

linux-chrome-105-scaledobject.yaml

  triggers:
    - type: selenium-grid
      metadata:
        url: 'http://seleniumgrid.com/graphql'
        browserName: 'chrome'
        browserVersion: '105.0'
        platformName: 'Linux'

linux-chrome-110-scaledobject.yaml

  triggers:
    - type: selenium-grid
      metadata:
        url: 'http://seleniumgrid.com/graphql'
        browserName: 'chrome'
        browserVersion: '110.0'
        platformName: 'Linux'
    - type: selenium-grid
      metadata:
        url: 'http://seleniumgrid.com/graphql'
        browserName: 'chrome'
        browserVersion: 'latest'
        platformName: 'Linux'

In the Selenium grid, when a session includes the following capabilities:

{
    "browserName": "chrome",
    "browserVersion": "105.0",
    "platformName": "linux"
}

It turns out that both ScaledObjects: linux-chrome-105-scaledobject and linux-chrome-110-scaledobject are being associated with the queued session in the Selenium grid.

Expected Behavior

The expected behavior is that only linux-chrome-105-scaledobject is triggered and associated with the queued session whose browserVersion capability is 105.0.

Actual Behavior

Both ScaledObjects: linux-chrome-105-scaledobject and linux-chrome-110-scaledobject are being associated with the queued session { "browserName": "chrome", "browserVersion": "105.0", "platformName": "linux"} in the Selenium grid.

Steps to Reproduce the Problem

  1. Define two ScaledObjects that represent different versions of a browser. Only one of them should have two triggers: the first one pointing to the specific version of the browser, and the second one set with browserVersion equal to latest.
  2. Run an automated test where the browserVersion value is not defined in any of the triggers of the ScaledObject that has latest as the browserVersion metadata in the defined capabilities.
  3. It is noticed that two pods are started almost at the same time: the pod associated with the deployment of linux-chrome-105-scaledobject and linux-chrome-110-scaledobject respectively.

Logs from KEDA operator

2023-03-09T16:01:13Z INFO scaleexecutor Successfully updated ScaleTarget {"scaledobject.Name": "linux-chrome-110-scaledobject", "scaledObject.Namespace": "selenium", "scaleTarget.Name": "linux-chrome-110", "Original Replicas Count": 0, "New Replicas Count": 1}
2023-03-09T16:01:16Z INFO scaleexecutor Successfully updated ScaleTarget {"scaledobject.Name": "linux-chrome-105-scaledobject", "scaledObject.Namespace": "selenium", "scaleTarget.Name": "linux-chrome-105", "Original Replicas Count": 0, "New Replicas Count": 1}

KEDA Version

2.9.3

Kubernetes Version

1.26

Platform

Any

Scaler Details

Selenium Grid Scaler

Anything else?

No response

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status

      Ready To Ship

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions