Hi! I have several (4) python selenium tests (each test in separate python file with test method) which I want to run on a BIT BUCKET PIPELINE. But it always fails after performing successfully 2 of 4 tests (tried to change order, used different commands for running them, but nothing helps).
All 4 run without any issues on local machine.
Is it something related to session lifetime for queued slots or something of the kind? Could it be memory issue? Don't quite get how to fix it, could you help me please, any ideas what I can try will be appreciated.
time="2023-12-27T12:12:11.699227163Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"time="2023-12-27T12:12:11.699406535Z" level=warning msg="Binding to IP address without --tlsverify is insecure and gives root access on this machine to everyone who has access to your network." host="tcp://0.0.0.0:2375"time="2023-12-27T12:12:11.699459523Z" level=warning msg="Binding to an IP address, even on localhost, can also give access to scripts run in a browser. Be safe out there!" host="tcp://0.0.0.0:2375"time="2023-12-27T12:12:12.699599198Z" level=warning msg="Binding to an IP address without --tlsverify is deprecated. Startup is intentionally being slowed down to show this message" host="tcp://0.0.0.0:2375"time="2023-12-27T12:12:12.699650228Z" level=warning msg="Please consider generating tls certificates with client validation to prevent exposing unauthenticated root access to your network" host="tcp://0.0.0.0:2375"time="2023-12-27T12:12:12.699664702Z" level=warning msg="You can override this by explicitly specifying '--tls=false' or '--tlsverify=false'" host="tcp://0.0.0.0:2375"time="2023-12-27T12:12:12.699681894Z" level=warning msg="Support for listening on TCP without authentication or explicit intent to run without authentication will be removed in the next release" host="tcp://0.0.0.0:2375"time="2023-12-27T12:12:27Z" level=warning msg="containerd config version `1` has been deprecated and will be removed in containerd v2.0, please switch to version `2`, see https://github.com/containerd/containerd/blob/main/docs/PLUGINS.md#version-header"time="2023-12-27T12:12:27.742544096Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"time="2023-12-27T12:12:27.743098517Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"time="2023-12-27T12:12:27.745033009Z" level=warning msg="failed to load plugin io.containerd.internal.v1.opt" error="mkdir /opt/containerd: read-only file system"time="2023-12-27T12:12:27.745089454Z" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"time="2023-12-27T12:12:27.784114982Z" level=warning msg="Your kernel does not support CPU realtime scheduler"time="2023-12-27T12:12:27.784134863Z" level=warning msg="Your kernel does not support cgroup blkio weight"time="2023-12-27T12:12:27.784140033Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"time="2023-12-27T12:12:28Z" level=info msg="Pipelines plugin request authorization." allowed=false method=HEAD plugin=pipelines uri=/_pingtime="2023-12-27T12:12:28.891172607Z" level=error msg="AuthZRequest for HEAD /_ping returned error: authorization denied by plugin pipelines: "time="2023-12-27T12:12:28Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/_pingtime="2023-12-27T12:12:28Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri="/v1.41/build?buildargs=%7B%7D&buildid=e0b3a18392bf51bba49874f6ff0dd29a680d915cdf531dce711cc3ba6a063659&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=%7B%7D&memory=0&memswap=0&networkmode=default&remote=client-session&rm=1&session=4urmns2m0end7qowp48cyic35&shmsize=0&target=&ulimits=null&version=2"time="2023-12-27T12:12:28Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri=/sessiontime="2023-12-27T12:12:44.377384391Z" level=warning msg="grpc: addrConn.createTransport failed to connect to {localhost <nil> 0 <nil>}. Err :connection error: desc = \"transport: Error while dialing only one connection allowed\". Reconnecting..." module=grpc2023-12-27 12:12:11,646 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing2023-12-27 12:12:11,649 INFO RPC interface 'supervisor' initialized2023-12-27 12:12:11,649 CRIT Server 'unix_http_server' running without any HTTP authentication checking2023-12-27 12:12:11,649 INFO supervisord started with pid 82023-12-27 12:12:12,651 INFO spawned: 'xvfb' with pid 92023-12-27 12:12:12,653 INFO spawned: 'vnc' with pid 102023-12-27 12:12:12,654 INFO spawned: 'novnc' with pid 112023-12-27 12:12:12,657 INFO spawned: 'selenium-standalone' with pid 12Setting up SE_NODE_GRID_URL...2023-12-27 12:12:12,665 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)2023-12-27 12:12:12,665 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)2023-12-27 12:12:12,665 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)2023-12-27 12:12:12,665 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)Selenium Grid Standalone configuration: [network]relax-checks = true[node]session-timeout = "300"override-max-sessions = falsedetect-drivers = falsedrain-after-session-count = 0max-sessions = 1[[node.driver-configuration]]display-name = "chrome"stereotype = '{"browserName": "chrome", "browserVersion": "120.0", "platformName": "Linux", "goog:chromeOptions": {"binary": "/usr/bin/google-chrome"}}'max-sessions = 1Starting Selenium Grid Standalone...Tracing is disabled12:12:13.100 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding12:12:13.111 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing12:12:13.687 INFO [NodeOptions.getSessionFactories] - Detected 4 available processors12:12:13.725 INFO [NodeOptions.report] - Adding chrome for {"browserName": "chrome","browserVersion": "120.0","goog:chromeOptions": {"binary": "\u002fusr\u002fbin\u002fgoogle-chrome"},"platformName": "linux","se:noVncPort": 7900,"se:vncEnabled": true} 1 times12:12:13.744 INFO [Node.<init>] - Binding additional locator mechanisms: relative12:12:13.759 INFO [GridModel.setAvailability] - Switching Node a3c46228-9323-45dc-ad50-56e2bdb2280d (uri: http://10.38.209.59:4444) from DOWN to UP12:12:13.759 INFO [LocalDistributor.add] - Added node a3c46228-9323-45dc-ad50-56e2bdb2280d at http://10.38.209.59:4444. Health check every 120s12:12:13.891 INFO [Standalone.execute] - Started Selenium Standalone 4.16.1 (revision 9b4c83354e): http://10.38.209.59:444412:12:50.699 INFO [LocalDistributor.newSession] - Session request received by the Distributor: [Capabilities {browserName: chrome, goog:chromeOptions: {args: [--ignore-ssl-errors=yes, --ignore-certificate-errors], extensions: []}, pageLoadStrategy: normal}]12:12:51.358 INFO [LocalNode.newSession] - Session created by the Node. Id: f7199b9f6b25e166289e7758fe1994be, Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 120.0.6099.109, chrome: {chromedriverVersion: 120.0.6099.109 (3419140ab66..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:37325}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://10.38.209.59:4444/sess..., se:cdpVersion: 120.0.6099.109, se:vnc: ws://10.38.209.59:4444/sess..., se:vncEnabled: true, se:vncLocalAddress: ws://10.38.209.59:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}12:12:51.364 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: f7199b9f6b25e166289e7758fe1994be Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 120.0.6099.109, chrome: {chromedriverVersion: 120.0.6099.109 (3419140ab66..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:37325}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://10.38.209.59:4444/sess..., se:cdpVersion: 120.0.6099.109, se:vnc: ws://10.38.209.59:4444/sess..., se:vncEnabled: true, se:vncLocalAddress: ws://10.38.209.59:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}12:18:03.375 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "24504b454bd111d72ffa40ae4bfb4c1b","eventTime": 1703679483371818659,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue","http.host": "localhost:4444","http.method": "POST","http.request_content_length": "220","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession","http.user_agent": "selenium\u002f4.15.2 (python linux)"}}12:18:13.753 INFO [LocalNode.stopTimedOutSession] - Session id f7199b9f6b25e166289e7758fe1994be timed out, stopping...12:18:13.900 INFO [LocalSessionMap.lambda$new$0] - Deleted session from local Session Map, Id: f7199b9f6b25e166289e7758fe1994be12:18:13.901 INFO [GridModel.release] - Releasing slot for session id f7199b9f6b25e166289e7758fe1994be12:18:13.901 INFO [SessionSlot.stop] - Stopping session f7199b9f6b25e166289e7758fe1994be12:18:13.908 INFO [LocalDistributor.newSession] - Session request received by the Distributor: [Capabilities {browserName: chrome, goog:chromeOptions: {args: [--ignore-ssl-errors=yes, --ignore-certificate-errors], extensions: []}, pageLoadStrategy: normal}]12:18:14.307 INFO [LocalNode.newSession] - Session created by the Node. Id: e6eb7896d0738558bdbb036a3168818d, Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 120.0.6099.109, chrome: {chromedriverVersion: 120.0.6099.109 (3419140ab66..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:36309}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://10.38.209.59:4444/sess..., se:cdpVersion: 120.0.6099.109, se:vnc: ws://10.38.209.59:4444/sess..., se:vncEnabled: true, se:vncLocalAddress: ws://10.38.209.59:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}12:18:14.309 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: e6eb7896d0738558bdbb036a3168818d Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 120.0.6099.109, chrome: {chromedriverVersion: 120.0.6099.109 (3419140ab66..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:36309}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:bidiEnabled: false, se:cdp: ws://10.38.209.59:4444/sess..., se:cdpVersion: 120.0.6099.109, se:vnc: ws://10.38.209.59:4444/sess..., se:vncEnabled: true, se:vncLocalAddress: ws://10.38.209.59:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}12:23:19.565 WARN [SeleniumSpanExporter$1.lambda$export$3] - {"traceId": "0f6da5d941a107b2582defa07a78151e","eventTime": 1703679799564851679,"eventName": "HTTP request execution complete","attributes": {"http.flavor": 1,"http.handler_class": "org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue","http.host": "localhost:4444","http.method": "POST","http.request_content_length": "220","http.scheme": "HTTP","http.status_code": 500,"http.target": "\u002fsession","http.user_agent": "selenium\u002f4.15.2 (python linux)"}}E at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)E at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)E at java.lang.Thread.run (Thread.java:829)/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py:229: SessionNotCreatedException=========================== short test summary info ============================FAILED tests/test_create_employee.py::EmployeeCreationTest::test_employee_creation - selenium.common.exceptions.SessionNotCreatedException: Message: Could not start a new session. New session request timed out Host info: host: '0c09449d-4825-41d3-8be2-513bc292c27c-mpp5j', ip: '10.39.56.47'Build info: version: '4.16.1', revision: '9b4c83354e'System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-1050-aws', java.version: '11.0.21'Driver info: driver.version: unknownStacktrace:at org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue.addToQueue (LocalNewSessionQueue.java:221)at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.lambda$new$0 (NewSessionQueue.java:68)at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle (Route.java:193)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.execute (NewSessionQueue.java:128)at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute (SpanWrappedHttpHandler.java:87)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.grid.router.Router.execute (Router.java:87)at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0 (EnsureSpecCompliantResponseHeaders.java:34)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$NestedRoute.handle (Route.java:271)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0 (AddWebDriverSpecHeaders.java:35)at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0 (SeleniumHandler.java:44)at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)at java.util.concurrent.FutureTask.run (FutureTask.java:264)at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)at java.lang.Thread.run (Thread.java:829)FAILED tests/test_service.py::ServiceCreationTest::test_service_creation - selenium.common.exceptions.SessionNotCreatedException: Message: Could not start a new session. New session request timed out Host info: host: '0c09449d-4825-41d3-8be2-513bc292c27c-mpp5j', ip: '10.39.56.47'Build info: version: '4.16.1', revision: '9b4c83354e'System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-1050-aws', java.version: '11.0.21'Driver info: driver.version: unknownStacktrace:at org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue.addToQueue (LocalNewSessionQueue.java:221)at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.lambda$new$0 (NewSessionQueue.java:68)at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle (Route.java:193)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.execute (NewSessionQueue.java:128)at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute (SpanWrappedHttpHandler.java:87)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.grid.router.Router.execute (Router.java:87)at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0 (EnsureSpecCompliantResponseHeaders.java:34)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$NestedRoute.handle (Route.java:271)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)at org.openqa.selenium.remote.http.Route.execute (Route.java:69)at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0 (AddWebDriverSpecHeaders.java:35)at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0 (SeleniumHandler.java:44)at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)at java.util.concurrent.FutureTask.run (FutureTask.java:264)at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)at java.lang.Thread.run (Thread.java:829)
UPDATE
So the solution is to increase max-session by passing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.