On bitbucket pipeline 2 tests of 4 run successfully and others fail while locally all 4 pass
Asked by elena_skorodilo:

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.  

**#bitbucket-pipelines.yml**   

image: python:3.11  

<br />

pipelines:  
default:  
- parallel:  
- step:  
size: 2x  
name: Test  
caches:  
- pip  
script:  
- export DOCKER_BUILDKIT=1  
- docker build .  
- if \[ -f requirements.txt \]; then pip install -r requirements.txt; fi  
- python3 -m pytest tests/\*  
services:  
- docker  
- selenium-chrome  

<br />

definitions:  
services:  
selenium-chrome:  
image: selenium/standalone-chrome:latest  
ports:  
- "4444:4444"  
restart: always  

**docker log**   
time="2023-12-27T12:12:11.699227163Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"  
3
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"  
4
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"  
5
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"  
6
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"  
7
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"  
8
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"  
9
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>"  
10
time="2023-12-27T12:12:27.742544096Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured"  
11
time="2023-12-27T12:12:27.743098517Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured"  
12
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"  
13
time="2023-12-27T12:12:27.745089454Z" level=error msg="failed to initialize a tracing processor \"otlp\"" error="no OpenTelemetry endpoint: skip plugin"  
14
time="2023-12-27T12:12:27.784114982Z" level=warning msg="Your kernel does not support CPU realtime scheduler"  
15
time="2023-12-27T12:12:27.784134863Z" level=warning msg="Your kernel does not support cgroup blkio weight"  
16
time="2023-12-27T12:12:27.784140033Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"  
17
time="2023-12-27T12:12:28Z" level=info msg="Pipelines plugin request authorization." allowed=false method=HEAD plugin=pipelines uri=/_ping  
18
time="2023-12-27T12:12:28.891172607Z" level=error msg="AuthZRequest for HEAD /_ping returned error: authorization denied by plugin pipelines: "  
19
time="2023-12-27T12:12:28Z" level=info msg="Pipelines plugin request authorization." allowed=true method=GET plugin=pipelines uri=/_ping  
20
time="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"  
21
time="2023-12-27T12:12:28Z" level=info msg="Pipelines plugin request authorization." allowed=true method=POST plugin=pipelines uri=/session  
22
time="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=grpc

<br />

**selenium-chrome service log**:  
2023-12-27 12:12:11,646 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing  
3
2023-12-27 12:12:11,649 INFO RPC interface 'supervisor' initialized  
4
2023-12-27 12:12:11,649 CRIT Server 'unix_http_server' running without any HTTP authentication checking  
5
2023-12-27 12:12:11,649 INFO supervisord started with pid 8  
6
2023-12-27 12:12:12,651 INFO spawned: 'xvfb' with pid 9  
7
2023-12-27 12:12:12,653 INFO spawned: 'vnc' with pid 10  
8
2023-12-27 12:12:12,654 INFO spawned: 'novnc' with pid 11  
9
2023-12-27 12:12:12,657 INFO spawned: 'selenium-standalone' with pid 12  
10
Setting up SE_NODE_GRID_URL...  
11
2023-12-27 12:12:12,665 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)  
12
2023-12-27 12:12:12,665 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)  
13
2023-12-27 12:12:12,665 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)  
14
2023-12-27 12:12:12,665 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)  
15
Selenium Grid Standalone configuration:  
16
[network]  
17
relax-checks = true  
18  
19
[node]  
20
session-timeout = "300"  
21
override-max-sessions = false  
22
detect-drivers = false  
23
drain-after-session-count = 0  
24
max-sessions = 1  
25  
26
[[node.driver-configuration]]  
27
display-name = "chrome"  
28
stereotype = '{"browserName": "chrome", "browserVersion": "120.0", "platformName": "Linux", "goog:chromeOptions": {"binary": "/usr/bin/google-chrome"}}'  
29
max-sessions = 1  
30  
31
Starting Selenium Grid Standalone...  
32
Tracing is disabled  
33
12:12:13.100 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding  
34
12:12:13.111 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing  
35
12:12:13.687 INFO [NodeOptions.getSessionFactories] - Detected 4 available processors  
36
12: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 times  
37
12:12:13.744 INFO [Node.<init>] - Binding additional locator mechanisms: relative  
38
12:12:13.759 INFO [GridModel.setAvailability] - Switching Node a3c46228-9323-45dc-ad50-56e2bdb2280d (uri: [http://10.38.209.59:4444](http://10.38.209.59:4444/)) from DOWN to UP  
39
12:12:13.759 INFO [LocalDistributor.add] - Added node a3c46228-9323-45dc-ad50-56e2bdb2280d at [http://10.38.209.59:4444](http://10.38.209.59:4444/). Health check every 120s  
40
12:12:13.891 INFO [Standalone.execute] - Started Selenium Standalone 4.16.1 (revision 9b4c83354e): [http://10.38.209.59:4444](http://10.38.209.59:4444/)  
41
12:12:50.699 INFO [LocalDistributor.newSession] - Session request received by the Distributor:  
42
[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--ignore-ssl-errors=yes, --ignore-certificate-errors], extensions: []}, pageLoadStrategy: normal}]  
43
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}  
44
12:12:51.364 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: f7199b9f6b25e166289e7758fe1994be  
45
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}  
46
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)"}}  
47  
48
12:18:13.753 INFO [LocalNode.stopTimedOutSession] - Session id f7199b9f6b25e166289e7758fe1994be timed out, stopping...  
49
12:18:13.900 INFO [LocalSessionMap.lambda$new$0] - Deleted session from local Session Map, Id: f7199b9f6b25e166289e7758fe1994be  
50
12:18:13.901 INFO [GridModel.release] - Releasing slot for session id f7199b9f6b25e166289e7758fe1994be  
51
12:18:13.901 INFO [SessionSlot.stop] - Stopping session f7199b9f6b25e166289e7758fe1994be  
52
12:18:13.908 INFO [LocalDistributor.newSession] - Session request received by the Distributor:  
53
[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--ignore-ssl-errors=yes, --ignore-certificate-errors], extensions: []}, pageLoadStrategy: normal}]  
54
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}  
55
12:18:14.309 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: e6eb7896d0738558bdbb036a3168818d  
56
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}  
57
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)"}}  
58  
59

****stack trace of failed tests****  
E at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)  
307
E at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)  
308
E at java.lang.Thread.run (Thread.java:829)  
309  
310
/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py:229: SessionNotCreatedException  
311
=========================== short test summary info ============================  
312
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  
313
Host info: host: '0c09449d-4825-41d3-8be2-513bc292c27c-mpp5j', ip: '10.39.56.47'  
314
Build info: version: '4.16.1', revision: '9b4c83354e'  
315
System info: [os.name](http://os.name/): 'Linux', os.arch: 'amd64', os.version: '5.15.0-1050-aws', java.version: '11.0.21'  
316
Driver info: driver.version: unknown  
317
Stacktrace:  
318
at org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue.addToQueue (LocalNewSessionQueue.java:221)  
319
at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.lambda$new$0 (NewSessionQueue.java:68)  
320
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle (Route.java:193)  
321
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
322
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
323
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
324
at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.execute (NewSessionQueue.java:128)  
325
at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute (SpanWrappedHttpHandler.java:87)  
326
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
327
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
328
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
329
at org.openqa.selenium.grid.router.Router.execute (Router.java:87)  
330
at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0 (EnsureSpecCompliantResponseHeaders.java:34)  
331
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
332
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
333
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
334
at org.openqa.selenium.remote.http.Route$NestedRoute.handle (Route.java:271)  
335
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
336
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
337
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
338
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
339
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
340
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
341
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
342
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
343
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
344
at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0 (AddWebDriverSpecHeaders.java:35)  
345
at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)  
346
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
347
at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)  
348
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
349
at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0 (SeleniumHandler.java:44)  
350
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)  
351
at java.util.concurrent.FutureTask.run (FutureTask.java:264)  
352
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)  
353
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)  
354
at java.lang.Thread.run (Thread.java:829)  
355
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  
356
Host info: host: '0c09449d-4825-41d3-8be2-513bc292c27c-mpp5j', ip: '10.39.56.47'  
357
Build info: version: '4.16.1', revision: '9b4c83354e'  
358
System info: [os.name](http://os.name/): 'Linux', os.arch: 'amd64', os.version: '5.15.0-1050-aws', java.version: '11.0.21'  
359
Driver info: driver.version: unknown  
360
Stacktrace:  
361
at org.openqa.selenium.grid.sessionqueue.local.LocalNewSessionQueue.addToQueue (LocalNewSessionQueue.java:221)  
362
at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.lambda$new$0 (NewSessionQueue.java:68)  
363
at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle (Route.java:193)  
364
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
365
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
366
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
367
at org.openqa.selenium.grid.sessionqueue.NewSessionQueue.execute (NewSessionQueue.java:128)  
368
at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute (SpanWrappedHttpHandler.java:87)  
369
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
370
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
371
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
372
at org.openqa.selenium.grid.router.Router.execute (Router.java:87)  
373
at org.openqa.selenium.grid.web.EnsureSpecCompliantResponseHeaders.lambda$apply$0 (EnsureSpecCompliantResponseHeaders.java:34)  
374
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
375
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
376
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
377
at org.openqa.selenium.remote.http.Route$NestedRoute.handle (Route.java:271)  
378
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
379
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
380
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
381
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
382
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
383
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
384
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
385
at org.openqa.selenium.remote.http.Route$CombinedRoute.handle (Route.java:345)  
386
at org.openqa.selenium.remote.http.Route.execute (Route.java:69)  
387
at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0 (AddWebDriverSpecHeaders.java:35)  
388
at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)  
389
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
390
at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0 (ErrorFilter.java:44)  
391
at org.openqa.selenium.remote.http.Filter$1.execute (Filter.java:63)  
392
at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0 (SeleniumHandler.java:44)  
393
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)  
394
at java.util.concurrent.FutureTask.run (FutureTask.java:264)  
395
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)  
396
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)  
397
at java.lang.Thread.run (Thread.java:829)


Answers:
author: elena_skorodilo
body: **UPDATE**   

So the solution is to increase max-session by passing  
SE_NODE_OVERRIDE_MAX_SESSIONS: 'true'  
SE_NODE_MAX_SESSIONS: 8  

So final bitbucket-pipelines.yml looks like this  

<br />

image: python:3.11  

<br />

pipelines:  
default:  
- parallel:  
- step:  
size: 2x  
shm_size: 2gb  
runs-on:  
- 'self.hosted'  
name: Test  
caches:  
- pip  
script:  
- export DOCKER_BUILDKIT=1  
- docker build .  
- if \[ -f requirements.txt \]; then pip install -r requirements.txt; fi  
- python3 -m pytest tests/\*  
services:  
- docker  
- selenium-chrome  

<br />

definitions:  
services:  
selenium-chrome:  
image: selenium/standalone-chrome:latest  
ports:  
- "4444:4444"  
restart: always  
environment:  
SE_NODE_OVERRIDE_MAX_SESSIONS: 'true'  
SE_NODE_MAX_SESSIONS: 8  

<br />


Tags: bitbucket-cloud

cloud