Skip to content

[🐛 Bug]: Selenium Hub container - status code is 200, even if the grid isn't ready #10391

@Bjego

Description

@Bjego

What happened?

When the grid isn't ready the healthcheck shouldn't return a 200 OK status code.

I think the correct status code would be 503.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses

When the grid would return a proper status code - health checks would make a real sense, which could lead to a pod restart.

image

How can we reproduce the issue?

Start a hub in kubernetes and see the health check statuscode in your browser. It's always "OK".

apiVersion: apps/v1
kind: Deployment
metadata:
  name: selenium-hub
  labels:
    app: selenium-hub
spec:
  replicas: 1
  selector:
    matchLabels:
      app: selenium-hub
  template:
    metadata:
      labels:
        app: selenium-hub
    spec:
      containers:
        - name: selenium-hub
          image: selenium/hub:4
          ports:
            - containerPort: 4444
            - containerPort: 4443
            - containerPort: 4442
          resources:
            limits:
              memory: "1000Mi"
              cpu: "500m"
            requests:
              memory: "250Mi"
              cpu: "10m"
          livenessProbe:
            httpGet:
              path: /wd/hub/status
              port: 4444
            initialDelaySeconds: 30
            timeoutSeconds: 5
          readinessProbe:
            httpGet:
              path: /wd/hub/status
              port: 4444
            initialDelaySeconds: 15
            timeoutSeconds: 5

Relevant log output

No server logs

Operating System

Docker Container

Selenium version

image: selenium/hub:4

What are the browser(s) and version(s) where you see this issue?

ignore

What are the browser driver(s) and version(s) where you see this issue?

ignore

Are you using Selenium Grid?

image: selenium/hub:4

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-gridEverything grid and server related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions