Skip to content

Unable to run in testcafe docker image on bitbucket pipelines #8406

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

Open
James-h143 opened this issue May 13, 2025 · 3 comments
Open

Unable to run in testcafe docker image on bitbucket pipelines #8406

James-h143 opened this issue May 13, 2025 · 3 comments
Labels
TYPE: bug The described behavior is considered as wrong (bug).

Comments

@James-h143
Copy link

James-h143 commented May 13, 2025

What is your Scenario?

I have a number of projects stuck running on a steadily aging build of the testcafe docker image as the tests refuse to run on newer versions of the image on bitbucket pipelines. I'm getting a connection error despite the --no-sandbox and --disable-dev-shm-usage flags recommended here being included

I have managed to create a basic app/test repo to demonstrate this issue here. you can find the error on pipeline #3 and the code that created the error on the fix-pipeline branch

ERROR Cannot establish one or more browser connections.

1 of 1 browser connections have not been established:

- chromium:headless --no-sandbox --disable-dev-shm-usage

Hints:

- Increase the Browser Initialization Timeout if its value is too low (currently: 2 minutes for local browsers and 6 minutes for remote browsers). The timeout determines how long TestCafe waits for browsers to be ready.

- The error can also be caused by network issues or remote device failure. Make sure that your network connection is stable and you can reach the remote device.

Type "testcafe -h" for help.

The image used for this demonstration is testcafe/testcafe:3.7.2 which seems to work in a local container

Image

but not when run in the bitbucket pipeline

perhaps i'm missing something obvious. i've been bashing my head against this problem for a couple days now

What is the Current behavior?

Connection error when run on bitbucket pipelines using testcafe docker image. no error when run locally using same docker image

What is the Expected behavior?

No connection errors in either scenario

What is the public URL of the test page? (attach your complete example)

It's a locally hosted app that is included in the example repo

What is your TestCafe test code?

see above

Your complete configuration file

Available in the example repo

Your complete test report

Available in links above

Screenshots

No response

Steps to Reproduce

Navigate to bitbucket repo
Select pipelines option
select branch fix-pipelines
select pipeline custom: run_tests
Click button Run

I can facilitate access to this repo if needed

TestCafe version

docker-image testcafe/testcafe:3.7.2

Node.js version

whatever is packaged in testcafe/testcafe:3.7.2

Command-line arguments

testcaferc.json supplied. nothing else passed on command line

Browser name(s) and version(s)

Chrome 132.0.0.0

Platform(s) and version(s)

Alpine Linux 3.22.0_alpha20250108

Other

No response

@James-h143 James-h143 added the TYPE: bug The described behavior is considered as wrong (bug). label May 13, 2025
@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label May 13, 2025
@aleks-pro
Copy link
Contributor

Hello @James-h143,

Thank you for the detailed report.

Could you please try the approach described here?

Refer to the following link to find a full code sample: https://github.com/DevExpress/testcafe/tree/c2c194ef102ed3758fcce849f573ca100ba522ea/examples/running-tests-in-chrome-using-bitbucket-pipelines-ci

I look forward to your results.

@testcafe-need-response-bot testcafe-need-response-bot bot removed the STATE: Need response An issue that requires a response or attention from the team. label May 20, 2025
@James-h143
Copy link
Author

James-h143 commented May 20, 2025

I have added the extra --disable-setuid-sandbox flag and moved the browser configuration into the command defined in the package.json file as per the document linked

I can see that the extra flag is being passed to testcafe and the previous browser configuration from the .testcaferc file is ignored in the logs

Image

The error remains the same.

I've even updated to use the cimg image in the code sample you linked and installed chrome separately as per the sample bitbucket-pipelines.yml example. logs

The error again remains the same

I branched off for this excursion. the branch for this is here

Also tried using the /opt/testcafe/docker/testcafe-docker.sh both with and without the chromium flags declared in the cli rather than the testcaferc.json

@testcafe-need-response-bot testcafe-need-response-bot bot added the STATE: Need response An issue that requires a response or attention from the team. label May 20, 2025
@Bayheck
Copy link
Collaborator

Bayheck commented May 23, 2025

Hello, thank you for sharing your logs with us. We will need some time to research the issue on our side. We will update you once we run our checks.

@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

3 participants