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

Error: connect ECONNREFUSED 127.0.0.1:34261 - trying to run tests in Docker #8187

Closed
akaribrahim opened this issue May 10, 2024 · 1 comment
Labels
TYPE: bug The described behavior is considered as wrong (bug).

Comments

@akaribrahim
Copy link

akaribrahim commented May 10, 2024

What is your Scenario?

When I try to run a simple test with the TestCafe Docker image, I get an error. I am using M1 Silicon Mac. TestCafe cannot connect Chrome or any browser.

What is the Current behavior?

Connection Refused error when I try with TestCafe official Docker image.


docker run -v ${PWD}/src/tests:/tests -it testcafe/testcafe chromium tests/simpleTest.js

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
ERROR Unable to open the "chromium:" browser due to the following error:

Error: connect ECONNREFUSED 127.0.0.1:40201
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1605:16)
    at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)

docker run -v ${PWD}/src/tests:/tests -it testcafe/testcafe chromium:headless tests/simpleTest.js

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
ERROR Cannot establish one or more browser connections.
1 of 1 browser connections have not been established:
- chromium:headless

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.

docker run -v ${PWD}/src/tests:/tests -it testcafe/testcafe firefox:headless tests/simpleTest.js

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
ERROR Cannot establish one or more browser connections.
1 of 1 browser connections have not been established:
- firefox:headless

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.

What is the Expected behavior?

Tests run locally. I expect it to work with Docker image as well.

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

To reproduce:

Pull latest testcafe image.
docker pull testcafe/testcafe

Write a simple testcode and run docker run command.
docker run -v ${PWD}/src/tests:/tests -it testcafe/testcafe chromium tests/simpleTest.js

What is your TestCafe test code?

fixture('Getting Started').page('https://devexpress.github.io/testcafe/example');

test('My first test', async (t) => {
  const developerNameInput = Selector('#developer-name');

  // Populate the developer name field
  await t.typeText(developerNameInput, 'Peter');
  const developerName = Selector('#developer-name').value;

  await t.expect(developerName).eql('Peter');
});

Your complete configuration file

No response

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

  1. docker pull testcafe/testcafe
  2. Write a simple test.
  3. docker run -v ${PWD}/src/tests:/tests -it testcafe/testcafe chromium tests/simpleTest.js

TestCafe version

latest testcafe image

Node.js version

No response

Command-line arguments

docker run -v ${PWD}/src/tests:/tests -it testcafe/testcafe chromium tests/simpleTest.js

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

No response

@akaribrahim akaribrahim added the TYPE: bug The described behavior is considered as wrong (bug). label May 10, 2024
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label May 10, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented May 14, 2024

Hello, TestCafe does not have an 'arm' docker image. Please refer to the following StackOveflow thread: https://stackoverflow.com/questions/67458621/how-to-run-amd64-docker-image-on-arm64-host-platform.

As a workaround, you can create your own TestCafe image, which is compatible with Linux/arm64/v8. Use our Dockerfile[https://github.com/DevExpress/testcafe/blob/1b17abddd46ba3575d044a0cd8c73deac424ec14/docker/Dockerfile] for this purpose.

@Bayheck Bayheck closed this as completed May 14, 2024
@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label May 14, 2024
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

2 participants