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

Testcafe fails on starting #8292

Closed
vasilyevi opened this issue Oct 1, 2024 · 10 comments
Closed

Testcafe fails on starting #8292

vasilyevi opened this issue Oct 1, 2024 · 10 comments
Labels
STATE: Need clarification An issue lacks information for further research. TYPE: bug The described behavior is considered as wrong (bug).

Comments

@vasilyevi
Copy link

vasilyevi commented Oct 1, 2024

What is your Scenario?

We have a set of tests which executes every 30 mins 24/7

What is the Current behavior?

We have around 50 executions per day, but 3-6 executions might be randomly failed. The test code is exactly same.

The "concurrency" and "quarantineMode" options from the configuration file will be ignored.
ERROR Cannot establish one or more browser connections.
1 of 2 browser connections have not been established:

  • chrome:headless

Hints:

  • Increase the Browser Initialization Timeout if its value is too low (currently: 2 minutes for all 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.

There is no logs, screenshots and even before hook is not started. How can we determine what happens? Or let me know what can we provide additionally. Code is not relevant the the code itself works fine, sometimes something goes wrong with testcase itself.

Tests are running in GH hosted agents with concurrency 2. browserInitTimeout is already huge, no issue with app under test.

We also have similar configuration of executions with playwright, no similar issues there. So I don't think the reason in GH hosted agent.

What is the Expected behavior?

Should work as other ~45 executions

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

N/A

What is your TestCafe test code?

N/A

Your complete configuration file

module.exports = {
screenshots: {
path: "./artifacts/screenshots",
takeOnFails: false,
pathPattern: "${DATE}${TIME}/${TEST}/${FILE_INDEX}${QUARANTINE_ATTEMPT}.png",
thumbnails: false
},
disableMultipleWindows: true,
browsers: "chrome:headless",
concurrency: 2,
skipJsErrors: true,
browserInitTimeout: 120000,
pageLoadTimeout: 60000,
pageRequestTimeout: 65000,
selectorTimeout: 20000,
testExecutionTimeout: 900000,
quarantineMode: false,
disableNativeAutomation: false,
testResults,
}

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

N/A

TestCafe version

3.6.0

Node.js version

v18

Command-line arguments

yarn testcafe

Browser name(s) and version(s)

No response

Platform(s) and version(s)

No response

Other

No response

@vasilyevi vasilyevi added the TYPE: bug The described behavior is considered as wrong (bug). label Oct 1, 2024
@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 Oct 1, 2024
@PavelMor25
Copy link
Collaborator

Hello @vasilyevi,

Without accurately reproducing the issue, it's difficult to determine what goes wrong.

Could you please try running TestCafe with a debug log? To enable the debug log, you can do the following:

set DEBUG=testcafe:*,hammerhead:*
testcafe chrome index.js 2> testcafe.log

Before running TestCafe, set the DEBUG environment variable as shown above. Then, run TestCafe and redirect the output to a file.

Please refer to the following help topic for details: https://testcafe.io/documentation/402636/faq/general-info#related-questions.

@PavelMor25 PavelMor25 added STATE: Need clarification An issue lacks information for further research. and removed STATE: Need response An issue that requires a response or attention from the team. labels Oct 7, 2024
@vasilyevi
Copy link
Author

vasilyevi commented Oct 9, 2024

@PavelMor25

2024-10-09T08:17:02.833Z testcafe:cli
[
'/opt/hostedtoolcache/node/20.17.0/x64/bin/node',
'/home/runner/work/tests/node_modules/gherkin-testcafe/main.js',
'--param-type-registry-file',
'./guide-to-common/features/steps/transformers.js',
'--src',
'./some.feature',
'./some.js',
2024-10-09T08:18:54.948Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.222 interception-job-210.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:55.952Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.223 interception-job-211.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:55.953Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.224 interception-job-212.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:55.956Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.223 interception-job-211.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:55.958Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.224 interception-job-212.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:56.021Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.225 interception-job-213.0 request http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:18:56.024Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.225 interception-job-213.0 response http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:18:56.962Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.226 interception-job-214.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:56.963Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.227 interception-job-215.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:56.965Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.226 interception-job-214.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:56.968Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.227 interception-job-215.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:57.972Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.228 interception-job-216.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:57.973Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.229 interception-job-217.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:57.977Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.228 interception-job-216.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:57.979Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.229 interception-job-217.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:58.014Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.230 interception-job-218.0 request http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:18:58.017Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.230 interception-job-218.0 response http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:18:58.993Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.231 interception-job-219.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:58.994Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.232 interception-job-220.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:18:58.998Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.231 interception-job-219.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:18:59.000Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.232 interception-job-220.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:00.013Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.233 interception-job-221.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:00.014Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.234 interception-job-222.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:00.015Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.235 interception-job-223.0 request http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:19:00.018Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.233 interception-job-221.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:00.020Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.234 interception-job-222.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:00.021Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.235 interception-job-223.0 response http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:19:01.032Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.236 interception-job-224.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:01.032Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.237 interception-job-225.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:01.035Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.236 interception-job-224.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:01.037Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.237 interception-job-225.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:02.022Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.238 interception-job-226.0 request http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:19:02.024Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.238 interception-job-226.0 response http://localhost:38567/browser/heartbeat/EsiCUd6
2024-10-09T08:19:02.040Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.239 interception-job-227.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:02.042Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.240 interception-job-228.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:02.043Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.239 interception-job-227.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:02.045Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.240 interception-job-228.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:03.047Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.241 interception-job-229.0 request http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:03.049Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.242 interception-job-230.0 request http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:03.052Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.241 interception-job-229.0 response http://localhost:38567/browser/init-script/EsiCUd6
2024-10-09T08:19:03.054Z testcafe:native-automation:request-pipeline:service-request requestPaused 2267.242 interception-job-230.0 response http://localhost:38567/browser/status/EsiCUd6
2024-10-09T08:19:03.130Z testcafe:browser:connection:plS5Naj status changed to 'closing'
2024-10-09T08:19:03.130Z testcafe:browser:connection:EsiCUd6 status changed to 'closing'
2024-10-09T08:19:03.133Z testcafe:browser:connection:plS5Naj TypeError: Cannot read properties of undefined (reading 'config')
at BrowserProviderPluginHost.isHeadlessBrowser (/home/runner/work/tests/node_modules/testcafe/src/browser/provider/built-in/dedicated/base.js:69:51)
at BrowserProvider.canUseDefaultWindowActions (/home/runner/work/tests/node_modules/testcafe/src/browser/provider/index.ts:266:53)
at BrowserProvider.closeBrowser (/home/runner/work/tests/node_modules/testcafe/src/browser/provider/index.ts:336:44)
at BrowserConnection._closeBrowser (/home/runner/work/tests/node_modules/testcafe/src/browser/connection/index.ts:304:13)
at BrowserConnection.close (/home/runner/work/tests/node_modules/testcafe/src/browser/connection/index.ts:513:9)
at Function._closeConnection (/home/runner/work/tests/node_modules/testcafe/src/runner/browser-set.ts:58:9)
2024-10-09T08:19:03.134Z testcafe:browser:connection:plS5Naj status changed to 'closed'
2024-10-09T08:19:03.137Z testcafe:native-automation nativeAutomation disposed
2024-10-09T08:19:05.248Z testcafe:browser:provider:chrome browser closed EsiCUd6
2024-10-09T08:19:05.248Z testcafe:browser:connection:EsiCUd6 status changed to 'closed'
ERROR Cannot establish one or more browser connections.
1 of 2 browser connections have not been established:

  • chrome:headless

Hints:

  • Increase the Browser Initialization Timeout if its value is too low (currently: 2 minutes for all 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.

@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 Oct 9, 2024
@github-actions github-actions bot removed the STATE: Need clarification An issue lacks information for further research. label Oct 9, 2024
@PavelMor25
Copy link
Collaborator

Hello @vasilyevi,

Try to run Chrome with --disable-search-engine-choice-screen arguments.

// configuration file
{
// ...
browsers: "chrome:headless --disable-search-engine-choice-screen",
// ...
}

@PavelMor25 PavelMor25 added STATE: Need clarification An issue lacks information for further research. and removed STATE: Need response An issue that requires a response or attention from the team. labels Oct 15, 2024
@vasilyevi
Copy link
Author

It does not help

@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 Oct 18, 2024
@github-actions github-actions bot removed the STATE: Need clarification An issue lacks information for further research. label Oct 18, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented Oct 21, 2024

Hello,

We have released testcafe 3.7.0-rc.1, which might address this issue.

Please test it and let us know your results.

@Bayheck Bayheck removed the STATE: Need response An issue that requires a response or attention from the team. label Oct 21, 2024
@Monforton
Copy link

Not OP, but I had this same issue and 3.7.0 fixed it

@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 Nov 4, 2024
@Bayheck Bayheck added STATE: Need clarification An issue lacks information for further research. and removed STATE: Need response An issue that requires a response or attention from the team. labels Nov 6, 2024
@testorangemac
Copy link

Also not the OP, but for us this issue is introduced since 3.7.0. We run the testcafe docker (chromium:headless) in the pipeline. It does not occur with every test job, but randomly (retry solves it).

@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 Nov 14, 2024
Copy link

This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone.

@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 Nov 16, 2024
@testorangemac
Copy link

Also not the OP, but for us this issue is introduced since 3.7.0. We run the testcafe docker (chromium:headless) in the pipeline. It does not occur with every test job, but randomly (retry solves it).

Still applicable for us with testcafe 3.7.0 and 3.7.1 :
image

We had to revert to testcafe 3.6.2 to have successful pipelines again.
Is it possible to re-open the issue?

@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 Dec 30, 2024
@Bayheck
Copy link
Collaborator

Bayheck commented Jan 7, 2025

Hello, I believe we fixed this issue as it was also in our internal backlog. We have not yet released this fix. Hopefully, we will add it to our next release. Please stay tuned.

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

No branches or pull requests

5 participants