Skip to content
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

[🐛 Bug]: Driver took too long to build. This is likely an issue with the browser or driver #2470

Open
alex270795 opened this issue Nov 22, 2024 · 2 comments

Comments

@alex270795
Copy link

What happened?

Hello, We are using Selenium Grid V4 and run tests via selenium-ide-runner.
When we run a large number of tests, they become queued and wait to be executed. But when 30 seconds pass and the test has not started, we get an error on Timeout.
image

It can be passed by increasing timeout hard-coded in script webdriver.ts
image

How is it possible to avoid this error or is it possible to define this Timeout for WebDriver via ${variable} ?

Command used to start Selenium Grid with Docker (or Kubernetes)

docker-compose-selenium-hub.yml:
---
services:
  selenium-hub:
    image: "docker.local:5000/selenium/hub:4.23.1"
    container_name: isos-selenium-hub
    ports:
      - 4442:4442
      - 4443:4443
      - 127.0.0.1:4444:4444
    volumes:
      - /etc/localtime:/etc/localtime:ro
    networks:
      - selenium-grid
    #deploy:
     # resources:
      #  limits:
       #   cpus: "1.0"
        #  memory: 512M
    environment:
      - SE_SESSION_REQUEST_TIMEOUT=10000
      - GRID_TIMEOUT=120
      - SE_ENABLE_TRACING=false
      - SE_ENABLE_TLS=true
      - SE_LOG_LEVEL=FINE
      - SE_STRUCTURED_LOGS=true
    restart: always
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: "3"

networks:
  selenium-grid:
---------------------------------
docker-compose-selenium-side-runner.yml    
---------------------------------
services:
  isos_selenium_runner:
    image: docker.local:5000/isos_selenium_runner:33 
    container_name: isos-selenium-cli
    networks:
      - selenium-grid
    environment:
      - SE_HUB_HOST=selenium-hub
      - SE_HUB_PORT=4444  
      
    env_file:
      - selenium.env
    volumes:
      - test_results:/opt/isos/selenium/test_results  # Mount directory for results;
      - screenshots:/opt/isos/selenium/screenshots
      - /etc/localtime:/etc/localtime:ro
    deploy:
      resources:
        limits:
       #   cpus: '1'
          memory: 4.5g
    restart: always
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"
    command: ["/bin/bash", "-c", "builtin declare -p | grep -Ev '\\b(BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID)=' > /container.env && crond && tail -f /dev/null"]

volumes:
  test_results:
  screenshots:

networks:
  selenium-grid:
    
----------------------------------------
docker-compose-chrome-node.yml
----------------------------------------
---
services:
  chrome:
    image: "docker.local:5000/selenium/node-chrome:4.23.1-20240820"
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_GRID_URL=https://selenium-hub:4444/wd/hub   # HTTPS address to register on Hub
      - SE_ENABLE_TLS=true
      - SE_ENABLE_TRACING=false
      - SE_SERVER_PROTOCOL=https
      - SE_START_XVFB=false
      - SE_NODE_SESSION_TIMEOUT=30                 #if a session in a stale state, will be killed
      - SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true      #to enable the cleanup
      - SE_BROWSER_LEFTOVERS_INTERVAL_SECS=240       #cleanup interval in seconds
      - SE_BROWSER_LEFTOVERS_PROCESSES_SECS=180      #browsers running for longer than this time will be killed
      - SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=1         #files generated by Chrome-based browsers in /tmp will be removed after these number of days (ignored when using Firefox)
      - SE_START_VNC=false
      #- SE_NODE_MAX_SESSIONS=2                      # 2 sessions will be active per container;
      - SE_LOG_LEVEL=FINE
      - SE_STRUCTURED_LOGS=true
      
    volumes:
      - /etc/localtime:/etc/localtime:ro
    networks:
      - selenium-grid
    deploy:
      replicas: 2
      resources:
        limits:
          cpus: "2.0"
          memory: 4G
    restart: always
    logging:
      driver: json-file
      options:
        max-size: 10m
        max-file: "3"

networks:
  selenium-grid:

Relevant log output

"Error: Driver took too long to build. This is likely an issue with the browser or driver.\n    at Timeout._onTimeout (/usr/local/lib/node_modules/selenium-side-runner/node_modules/@seleniumhq/side-runtime/src/webdriver.ts:200:13)\n    at listOnTimeout (node:internal/timers:594:17)\n    at processTimers (node:internal/timers:529:7)"

Operating System

Rocky Linux 9

Docker Selenium version (image tag)

4.23.1

Selenium Grid chart version (chart version)

No response

Copy link

@alex270795, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@alex270795
Copy link
Author

Hi Team,
any news please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant