Skip to content

[🐛 Bug]: Chrome profiles not getting deleted after driver quit #3140

Description

@rummitta

What happened?

Hi Team,
Please refer to this ticket - SeleniumHQ/selenium#17518 (comment)
Even after setting the variables, the chrome profiles still remain. Is there any specific directory where the user-data-dir need to be set. Is there any specific folder name pattern that need to be used so that clean up script automatically picks it up for clean up. Presently these are the variables set:
SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true -- For cleanup enable
SE_BROWSER_LEFTOVERS_INTERVAL_SECS=300 -- Cleanup in every 5mins
SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=0 -- Delete temporary file more than 1 day after browser closes
SE_BROWSER_LEFTOVERS_PROCESSES_SECS=3600
Regards,
Rumki

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

compose file content below:
version: "3.4"
services:
  chrome:
    image: selenium/node-chrome:latest
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_MAX_SESSIONS=3
      - SE_VNC_NO_PASSWORD=1
      - SE_NODE_SESSION_TIMEOUT=300
      - SE_NODE_OVERRIDE_MAX_SESSIONS=true
      - SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true
      - SE_BROWSER_LEFTOVERS_INTERVAL_SECS=300
      - SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=1
      - SE_BROWSER_LEFTOVERS_PROCESSES_SECS=300
    volumes:
      - selDownloadsTestPlus:/home/seluser/Downloads
      
  edge:
    image: selenium/node-edge:latest
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_MAX_SESSIONS=3
      - SE_VNC_NO_PASSWORD=1
      - SE_NODE_SESSION_TIMEOUT=300
      - SE_NODE_OVERRIDE_MAX_SESSIONS=true
    volumes:
      - selDownloadsTestPlus:/home/seluser/Downloads
    

  firefox:
    image: selenium/node-firefox:latest
    shm_size: 2gb
    depends_on:
      - selenium-hub
    environment:
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_MAX_SESSIONS=3
      - SE_VNC_NO_PASSWORD=1
      - SE_NODE_SESSION_TIMEOUT=300
      - SE_NODE_OVERRIDE_MAX_SESSIONS=true
    volumes:
      - selDownloadsTestPlus:/home/seluser/Downloads


  selenium-hub:
    image: selenium/hub:latest
    container_name: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4445:4444"
    environment:
       - SE_SESSION_TIMEOUT=900
       - SE_SESSION_REQUEST_TIMEOUT=900
       - SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true
       - SE_BROWSER_LEFTOVERS_INTERVAL_SECS=30
       - SE_BROWSER_LEFTOVERS_TEMPFILES_DAYS=1
       - SE_BROWSER_LEFTOVERS_PROCESSES_SECS=300
volumes:
  selDownloadsTestPlus:
    name: selDownloadsTestPlus
    external: false

Relevant log output

Clean up script says it is done - please refer to the screenshots from the original ticket - https://github.com/SeleniumHQ/selenium/issues/17518#issuecomment-4488170886

Operating System

docker

Docker Selenium version (image tag)

4.43

Selenium Grid chart version (chart version)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions