DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 671 forks source link

Chrome 130 fails to start during local execution on MAC -> Error: WebSocket connection closed (Failed to dispose lockfile) #8304

Closed TsvetanTsvetkovClevertap closed 1 hour ago

TsvetanTsvetkovClevertap commented 2 days ago

What is your Scenario?

Trying to run the framework.

After updating Chrome to latest current official version 130.0.6723.59

TestCafe is crashing on initialisation. Chrome would not start.

What is the Current behavior?

When the framework is initiated, Chrome opens up for some miliseconds and closes immediately afterwards

What is the Expected behavior?

To work

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

N/A It is irrelevant

What is your TestCafe test code?

Irrelevant in this case, config file is more important

Your complete configuration file

We use configuration files. This is the common.js which sets the main execution params, then this is merged to the specific "suite" config files which use various filtering and addition settings per test suite.

image image

Your complete test report

Here is the DEBUG=testcafe* log

/Users/***/.nvm/versions/node/v20.10.0/bin/yarn run e2e:andOpenAllureReport yarn run v1.22.21

$ BUILD_ENTRY=main-app,app-setup NODE_OPTIONS='--max-old-space-size=4096 --openssl-config=./openssl.cnf' node web/test/e2e/runner.js && cd web/test/e2e/allure && node openReport.js

Test Config

Sut: sk2 Config File: testsuites/platformSanity Concurrency: 1

Tags:
Args:
Retest:

Browserslist: caniuse-lite is outdated. Please run: npx update-browserslist-db@latest Why you should do it regularly: https://github.com/browserslist/update-db#readme testcafe:version 3.5.0 +0ms

TestCafe Browser configuration: chrome:/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --disable-search-engine-choice-screen

testcafe:reporter begin dispatchToPlugin method: init testcafe:reporter [ '3.5.0' ] +0ms testcafe:reporter begin dispatchToPlugin method: init testcafe:reporter [ '3.5.0' ] +1ms testcafe:reporter end dispatchToPlugin method: init +0ms testcafe:reporter end dispatchToPlugin method: init +0ms testcafe:runner testcafe:runner TestCafeConfiguration { testcafe:runner _options: { testcafe:runner concurrency: Option { testcafe:runner name: 'concurrency', testcafe:runner value: 1, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner baseUrl: Option { testcafe:runner name: 'baseUrl', testcafe:runner value: '’masked for security reasons', testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner browsers: Option { testcafe:runner name: 'browsers', testcafe:runner value: [Array], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner cache: Option { testcafe:runner name: 'cache', testcafe:runner value: true, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner skipJsErrors: Option { testcafe:runner name: 'skipJsErrors', testcafe:runner value: true, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner browserInitTimeout: Option { testcafe:runner name: 'browserInitTimeout', testcafe:runner value: 300000, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner pageRequestTimeout: Option { testcafe:runner name: 'pageRequestTimeout', testcafe:runner value: 300000, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner reporter: Option { testcafe:runner name: 'reporter', testcafe:runner value: [Array], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner screenshots: Option { testcafe:runner name: 'screenshots', testcafe:runner value: [Object], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner speed: Option { testcafe:runner name: 'speed', testcafe:runner value: 0.95, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner tags: Option { testcafe:runner name: 'tags', testcafe:runner value: [Array], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner hooks: Option { testcafe:runner name: 'hooks', testcafe:runner value: [Object], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner src: Option { testcafe:runner name: 'src', testcafe:runner value: [Array], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner filter: Option { testcafe:runner name: 'filter', testcafe:runner value: [Function: filter], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner quarantineMode: Option { testcafe:runner name: 'quarantineMode', testcafe:runner value: [Object], testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner developmentMode: Option { testcafe:runner name: 'developmentMode', testcafe:runner value: false, testcafe:runner source: 'Default' testcafe:runner }, testcafe:runner retryTestPages: Option { testcafe:runner name: 'retryTestPages', testcafe:runner value: false, testcafe:runner source: 'Default' testcafe:runner }, testcafe:runner disableHttp2: Option { testcafe:runner name: 'disableHttp2', testcafe:runner value: false, testcafe:runner source: 'Default' testcafe:runner }, testcafe:runner disableNativeAutomation: Option { testcafe:runner name: 'disableNativeAutomation', testcafe:runner value: false, testcafe:runner source: 'Default' testcafe:runner }, testcafe:runner disableCrossDomain: Option { testcafe:runner name: 'disableCrossDomain', testcafe:runner value: false, testcafe:runner source: 'Default' testcafe:runner }, testcafe:runner experimentalMultipleWindows: Option { testcafe:runner name: 'experimentalMultipleWindows', testcafe:runner value: false, testcafe:runner source: 'Default' testcafe:runner }, testcafe:runner configFile: Option { testcafe:runner name: 'configFile', testcafe:runner value: 'web/test/e2e/config/testsuites/platformSanity.js', testcafe:runner source: 'Input' testcafe:runner }, testcafe:runner port1: Option { testcafe:runner name: 'port1', testcafe:runner value: 57257, testcafe:runner source: 'Input' testcafe:runner }, testcafe:runner port2: Option { testcafe:runner name: 'port2', testcafe:runner value: 57258, testcafe:runner source: 'Input' testcafe:runner }, testcafe:runner debugMode: Option { testcafe:runner name: 'debugMode', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner debugOnFail: Option { testcafe:runner name: 'debugOnFail', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner skipUncaughtErrors: Option { testcafe:runner name: 'skipUncaughtErrors', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner stopOnFirstFail: Option { testcafe:runner name: 'stopOnFirstFail', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner takeScreenshotsOnFails: Option { testcafe:runner name: 'takeScreenshotsOnFails', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner disablePageCaching: Option { testcafe:runner name: 'disablePageCaching', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner disablePageReloads: Option { testcafe:runner name: 'disablePageReloads', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner disableScreenshots: Option { testcafe:runner name: 'disableScreenshots', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner disableMultipleWindows: Option { testcafe:runner name: 'disableMultipleWindows', testcafe:runner value: false, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner selectorTimeout: Option { testcafe:runner name: 'selectorTimeout', testcafe:runner value: 10000, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner assertionTimeout: Option { testcafe:runner name: 'assertionTimeout', testcafe:runner value: 3000, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner pageLoadTimeout: Option { testcafe:runner name: 'pageLoadTimeout', testcafe:runner value: 3000, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner appInitDelay: Option { testcafe:runner name: 'appInitDelay', testcafe:runner value: 1000, testcafe:runner source: 'Configuration' testcafe:runner }, testcafe:runner compilerOptions: Option { testcafe:runner name: 'compilerOptions', testcafe:runner value: [Object], testcafe:runner source: 'Configuration' testcafe:runner } testcafe:runner }, testcafe:runner _defaultPaths: [ testcafe:runner '/Users/masked for security/config/testsuites/platformSanity.js' testcafe:runner ], testcafe:runner _filePath: '/Users/masked for security/config/testsuites/platformSanity.js', testcafe:runner _overriddenOptions: [], testcafe:runner _isExplicitConfig: true testcafe:runner } testcafe:runner +0ms testcafe:browser-tools:exec NativeBinaryHasFailedError: The find-window process failed with the 103 exit code. testcafe:browser-tools:exec Process output: testcafe:browser-tools:exec testcafe:browser-tools:exec Exit code: 103 testcafe:browser-tools:exec at runWithMacApp (/Users/masked for security/node_modules/testcafe-browser-tools/src/utils/exec.js:113:19) testcafe:browser-tools:exec at processTicksAndRejections (node:internal/process/task_queues:95:5) testcafe:browser-tools:exec at execFile (/Users/masked for security/node_modules/testcafe-browser-tools/src/utils/exec.js:126:20) testcafe:browser-tools:exec at runFindWindowBinary (/Users/masked for security/node_modules/testcafe-browser-tools/src/api/find-window.js:23:16) testcafe:browser-tools:exec at default_1 (/Users/masked for security/node_modules/testcafe-browser-tools/src/api/find-window.js:43:15) testcafe:browser-tools:exec at checkAuthentication (/Users/masked for security/node_modules/testcafe/src/cli/authentication-helper.ts:28:26) testcafe:browser-tools:exec at authenticationHelper (/Users/masked for security/node_modules/testcafe/src/cli/authentication-helper.ts:43:29) testcafe:browser-tools:exec at Runner._checkRequiredPermissions (/Users/masked for security/node_modules/testcafe/src/runner/index.js:652:27) testcafe:browser-tools:exec at Runner._validateBrowsers (/Users/masked for security/node_modules/testcafe/src/runner/index.js:318:13) testcafe:browser-tools:exec at Runner._validateRunOptions (/Users/masked for security/node_modules/testcafe/src/runner/index.js:486:9) testcafe:browser-tools:exec at Runner._prepareOptions (/Users/masked for security/node_modules/testcafe/src/runner/index.js:599:9) testcafe:browser-tools:exec at Runner._getRunTaskOptions (/Users/masked for security/node_modules/testcafe/src/runner/index.js:603:9) { testcafe:browser-tools:exec data: { testcafe:browser-tools:exec binary: 'find-window', testcafe:browser-tools:exec exitCode: 103, testcafe:browser-tools:exec output: '\nExit code: 103\n' testcafe:browser-tools:exec }, testcafe:browser-tools:exec code: 'E003' testcafe:browser-tools:exec } +0ms testcafe:hammerhead:proxy:router register route GET /hammerhead.js +0ms testcafe:hammerhead:proxy:router register route GET /transport-worker.js +7ms testcafe:hammerhead:proxy:router register route GET /worker-hammerhead.js +0ms testcafe:hammerhead:proxy:router register route GET /messaging +0ms testcafe:hammerhead:proxy:router register route POST /messaging +0ms testcafe:hammerhead:proxy:router register route OPTIONS /messaging +0ms testcafe:hammerhead:proxy:router register route GET /task.js +0ms testcafe:hammerhead:proxy:router register route GET /iframe-task.js +0ms testcafe:hammerhead:proxy:router register route GET /browser/connect/{id} +8ms testcafe:hammerhead:proxy:router register route GET /browser/heartbeat/{id} +0ms testcafe:hammerhead:proxy:router register route GET /browser/idle/{id} +0ms testcafe:hammerhead:proxy:router register route GET /browser/idle-forced/{id} +0ms testcafe:hammerhead:proxy:router register route GET /browser/status/{id} +0ms testcafe:hammerhead:proxy:router register route GET /browser/status-done/{id} +0ms testcafe:hammerhead:proxy:router register route GET /browser/init-script/{id} +0ms testcafe:hammerhead:proxy:router register route POST /browser/init-script/{id} +0ms testcafe:hammerhead:proxy:router register route GET /browser/active-window-id/{id} +0ms testcafe:hammerhead:proxy:router register route POST /browser/active-window-id/{id} +0ms testcafe:hammerhead:proxy:router register route POST /browser/ensure-window-in-native-automation/{id} +0ms testcafe:hammerhead:proxy:router register route POST /browser/close-window/{id} +0ms testcafe:hammerhead:proxy:router register route POST /browser/open-file-protocol/{id} +1ms testcafe:hammerhead:proxy:router register route POST /browser/dispatch-native-automation-event/{id} +0ms testcafe:hammerhead:proxy:router register route POST /parse-selector/{id} +0ms testcafe:hammerhead:proxy:router register route POST /browser/dispatch-native-automation-event-sequence/{id} +0ms testcafe:hammerhead:proxy:router register route GET /browser/connect +0ms testcafe:hammerhead:proxy:router register route GET /browser/connect/ +0ms testcafe:hammerhead:proxy:router register route GET /service-worker.js +0ms testcafe:hammerhead:proxy:router register route GET /browser/assets/index.js +0ms testcafe:hammerhead:proxy:router register route GET /browser/assets/styles.css +0ms testcafe:hammerhead:proxy:router register route GET /browser/assets/logo.svg +0ms testcafe:hammerhead:proxy:router register route GET /about:error +0ms testcafe:hammerhead:proxy:router register route GET /testcafe-core.js +0ms testcafe:hammerhead:proxy:router register route GET /testcafe-driver.js +1ms testcafe:hammerhead:proxy:router register route GET /testcafe-legacy-runner.js +0ms testcafe:hammerhead:proxy:router register route GET /testcafe-automation.js +1ms testcafe:hammerhead:proxy:router register route GET /testcafe-ui.js +1ms testcafe:hammerhead:proxy:router register route GET /testcafe-ui-sprite.png +0ms testcafe:hammerhead:proxy:router register route GET /testcafe-ui-sprite.svg +0ms testcafe:hammerhead:proxy:router register route GET /favicon.ico +0ms testcafe:hammerhead:proxy:router register route GET /testcafe-ui-styles.css +0ms testcafe:utils:temp-directory Found temp directories: [ 'chrome-profile-84840YIcDkveYuLt6' ] +0ms testcafe:utils:temp-directory Temp directory path: /var/folders/lt/g3zfz2bj3wx9136qbjxhc5q00000gn/T/testcafe/chrome-profile-84840YIcDkveYuLt6 +1ms testcafe:bootstrapper tests compilation took 6.85 s +0ms testcafe:browser-tools:open 'open -n -a "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --args http://localhost:57257/browser/connect/auK5Ami --remote-debugging-port=57262 --user-data-dir=/var/folders/lt/g3zfz2bj3wx9136qbjxhc5q00000gn/T/testcafe/chrome-profile-84840YIcDkveYuLt6 --disable-search-engine-choice-screen --disable-popup-blocking --disable-infobars --disable-session-crashed-bubble --no-first-run --new-window --disable-background-networking --disable-ipc-flooding-protection --disable-background-timer-throttling --disable-backgrounding-occluded-windows --autoplay-policy=no-user-gesture-required' +0ms testcafe:browser:connection:auK5Ami status changed to 'ready' +0ms testcafe:browser:provider:built-in:chrome:browser-client:auK5Ami CDP method 'PageEnable' took 1.72 ms +0ms testcafe:native-automation starting +0ms testcafe:browser:connection:auK5Ami Error: Unable to open the "chrome:/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --disable-search-engine-choice-screen" browser due to the following error: testcafe:browser:connection:auK5Ami testcafe:browser:connection:auK5Ami Error: WebSocket connection closed testcafe:browser:connection:auK5Ami at /Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:94:35 testcafe:browser:connection:auK5Ami at Chrome._handleConnectionClose (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:256:13) testcafe:browser:connection:auK5Ami at WebSocket. (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:243:22) testcafe:browser:connection:auK5Ami at WebSocket.emit (node:events:514:28) testcafe:browser:connection:auK5Ami at WebSocket.emit (node:domain:488:12) testcafe:browser:connection:auK5Ami at WebSocket.emitClose (/Users/masked for security/node_modules/ws/lib/websocket.js:246:10) testcafe:browser:connection:auK5Ami at Socket.socketOnClose (/Users/masked for security/node_modules/ws/lib/websocket.js:1148:15) testcafe:browser:connection:auK5Ami at Socket.emit (node:events:514:28) testcafe:browser:connection:auK5Ami at Socket.emit (node:domain:488:12) testcafe:browser:connection:auK5Ami at TCP. (node:net:337:12) testcafe:browser:connection:auK5Ami at BrowserConnection._runBrowser (/Users/masked for security/node_modules/testcafe/src/browser/connection/index.ts:290:32) +480ms testcafe:browser:connection:auK5Ami status changed to 'closing' +5ms Unexpected error occurred while running TestCafe e2e tests GeneralError: Unable to open the "chrome:/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --disable-search-engine-choice-screen" browser due to the following error:

Error: WebSocket connection closed at /Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:94:35 at Chrome._handleConnectionClose (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:256:13) at WebSocket. (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:243:22) at WebSocket.emit (node:events:514:28) at WebSocket.emit (node:domain:488:12) at WebSocket.emitClose (/Users/masked for security/node_modules/ws/lib/websocket.js:246:10) at Socket.socketOnClose (/Users/masked for security/node_modules/ws/lib/websocket.js:1148:15) at Socket.emit (node:events:514:28) at Socket.emit (node:domain:488:12) at TCP. (node:net:337:12) at BrowserConnection._runBrowser (/Users/masked for security/node_modules/testcafe/src/browser/connection/index.ts:290:32) { code: 'E1038', data: [ 'chrome:/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --disable-search-engine-choice-screen', 'Error: WebSocket connection closed\n' + ' at /Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:94:35\n' + ' at Chrome._handleConnectionClose (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:256:13)\n' + ' at WebSocket. (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:243:22)\n' + ' at WebSocket.emit (node:events:514:28)\n' + ' at WebSocket.emit (node:domain:488:12)\n' + ' at WebSocket.emitClose (/Users/masked for security/node_modules/ws/lib/websocket.js:246:10)\n' + ' at Socket.socketOnClose (/Users/masked for security/node_modules/ws/lib/websocket.js:1148:15)\n' + ' at Socket.emit (node:events:514:28)\n' + ' at Socket.emit (node:domain:488:12)\n' + ' at TCP. (node:net:337:12)' ] } Error: Unable to open the "chrome:/Applications/Google Chrome.app/Contents/MacOS/Google Chrome --disable-search-engine-choice-screen" browser due to the following error:

Error: WebSocket connection closed at /Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:94:35 at Chrome._handleConnectionClose (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:256:13) at WebSocket. (/Users/masked for security/node_modules/chrome-remote-interface/lib/chrome.js:243:22) at WebSocket.emit (node:events:514:28) at WebSocket.emit (node:domain:488:12) at WebSocket.emitClose (/Users/masked for security/node_modules/ws/lib/websocket.js:246:10) at Socket.socketOnClose (/Users/masked for security/node_modules/ws/lib/websocket.js:1148:15) at Socket.emit (node:events:514:28) at Socket.emit (node:domain:488:12) at TCP. (node:net:337:12) at BrowserConnection._runBrowser (/Users/masked for security/node_modules/testcafe/src/browser/connection/index.ts:290:32) testcafe:utils:temp-directory:lockfile Failed to dispose lockfile /var/folders/lt/g3zfz2bj3wx9136qbjxhc5q00000gn/T/testcafe/chrome-profile-84840YIcDkveYuLt6/.testcafe-lockfile +0ms testcafe:utils:temp-directory:lockfile Error: ENOENT: no such file or directory, unlink '/var/folders/lt/g3zfz2bj3wx9136qbjxhc5q00000gn/T/testcafe/chrome-profile-84840YIcDkveYuLt6/.testcafe-lockfile' testcafe:utils:temp-directory:lockfile at Object.unlinkSync (node:fs:1868:18) testcafe:utils:temp-directory:lockfile at LockFile.dispose (/Users/masked for security/node_modules/testcafe/src/utils/temp-directory/lockfile.js:57:16) testcafe:utils:temp-directory:lockfile at TempDirectory._disposeSync (/Users/masked for security/node_modules/testcafe/src/utils/temp-directory/index.js:65:23) testcafe:utils:temp-directory:lockfile at /Users/masked for security/node_modules/testcafe/src/utils/temp-directory/index.js:79:64 testcafe:utils:temp-directory:lockfile at Array.forEach () testcafe:utils:temp-directory:lockfile at disposeDirectoriesSync (/Users/masked for security/node_modules/testcafe/src/utils/temp-directory/index.js:79:39) testcafe:utils:temp-directory:lockfile at runHook (/Users/masked for security/node_modules/async-exit-hook/index.js:56:10) testcafe:utils:temp-directory:lockfile at Array.map () testcafe:utils:temp-directory:lockfile at exit (/Users/masked for security/node_modules/async-exit-hook/index.js:25:8) testcafe:utils:temp-directory:lockfile at process.events. (/Users/masked for security/node_modules/async-exit-hook/index.js:115:3) +0ms error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Process finished with exit code 1

Screenshots

No response

Steps to Reproduce

  1. Run the Framework

TestCafe version

3.5.0

Node.js version

20.10.0

Command-line arguments

$ BUILD_ENTRY=main-app,app-setup NODE_OPTIONS='--max-old-space-size=4096 --openssl-config=./openssl.cnf' node /runner.js && cd /allure && node openReport.js

Browser name(s) and version(s)

Chrome 130.0.6723.59

Platform(s) and version(s)

macOS 14.4.1 (23E224)

Other

The debug log points to Chrome profile not being disposed

Failed to dispose lockfile /var/folders/lt/g3zfz2bj3wx9136qbjxhc5q00000gn/T/testcafe/chrome-profile-84840YIcDkveYuLt6/.testcafe-lockfile

gforepsly commented 2 hours ago

Linking the same issue for the reference: https://github.com/DevExpress/testcafe/issues/8240

We are experience the same issue - Workaround is using the Edge.

Bayheck commented 1 hour ago

Hello,

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

Please take a look and let us know your results.

I will be closing this issue as a duplicate of https://github.com/DevExpress/testcafe/issues/8300.

TsvetanTsvetkovClevertap commented 1 hour ago

Thank you, 3.7.0-rc.1 resolves the issue!