SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.81k stars 765 forks source link

Selenium-side-runner takes long time to start tests #697

Open shansb-dev opened 5 years ago

shansb-dev commented 5 years ago

🐛 Bug Report

After install of selenium-side-runner I am experiencing a huge delay between the cmd execution and the tests execution. When using the --debug flag it takes ~5 minutest until the jest debug messages appear and the selenium test are finally executed. Does anybody have an idea why?

debug:   Could not load /tmp/tests/.side.yml
debug:   { capabilities: { browserName: 'chrome', chromeOptions: { args: [Array] } },
  params: {},
  runId: 'ef3c15320ec04e50a992842fd11194ab',
  path: '/usr/local/lib/node_modules/',
  server: undefined,
  timeout: 15000,
  baseUrl: undefined,
  outputFormat: [Function] }
info:    Running test.side
added 25 packages from 22 contributors and audited 37 packages in 6.466s
found 0 vulnerabilities
        <====== HERE ~ 5 minutes nothing ======>
debug:   jest worker args
debug:    0=--no-watchman, 1=--testMatch, 2={**/***/*.test.js,**/***.test.js}
debug:   jest work opts
debug:    cwd=/tmp/tests/side-suite-test, stdio=inherit
 PASS  ./Test.test.js (130.872s)
  Test
    ✓ test (127892ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        131.115s
Ran all test suites.

To Reproduce

selenium-side-runner --debug -c "browserName=chrome chromeOptions.args=[no-sandbox, headless]" test.side

(It probably does not make any difference which capabilities are set but my machine is only able to run it headless.)

Expected behavior

Test should start more or less immediately.

Project file reproducing this issue (highly encouraged)

Any .side file will do, e.g.

{ "id": "12d70a4d-f0e6-40dd-9cd3-293f0c255ba9", "version": "2.0", "name": "test", "url": "https://www.google.com", "tests": [{ "id": "a2b75cbd-7ec5-43af-9e98-528cfd9d2d9a", "name": "test", "commands": [{ "id": "6292a107-1de3-4119-a166-262aa26939da", "comment": "", "command": "open", "target": "/", "targets": [], "value": "" }] }], "suites": [{ "id": "f685240e-7d02-4db1-a6f0-6195a22b2f45", "name": "Test", "persistSession": false, "parallel": false, "timeout": 300, "tests": ["a2b75cbd-7ec5-43af-9e98-528cfd9d2d9a"] }], "urls": ["https://www.google.com/"], "plugins": [] }

Environment

Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial Selenium IDE 3.7.4 NODE v10.15.3 NPM 6.4.1 Google Chrome 74.0.3729.157 selenium-side-runner 3.7.4 ChromeDriver 74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29})

corevo commented 5 years ago

I tried to reach out to you yesterday on slack, anyway, I wanted to know if this persists or after the first time you use it, it runs smoothly.

shansb-dev commented 5 years ago

Hello corevo thank you for your reply. Yes it still persists on each execution. When using the --debug option it can be seen that the selenium-side-runner waits or maybe does sth without logging debug messages between the vulnerability check and the first jest debugging messages.

shansb-dev commented 5 years ago

Okay this seems to be an issue with the last few versions 3.7.x, selenium-side-runner 3.6.1 works as expected.

corevo commented 5 years ago

Thank you for the information, if you could try narrowing it further to the specific version that broke it, that would be very helpful, I'm assuming 3.7.1 regressed.

shansb-dev commented 5 years ago

I tried each of the last few versions. 3.7.3 and 3.7.1 both started immediately like they should, but these versions threw an exception in jest-junit (-> output junit-xml). Therefore I will stick to 3.6.1 for now.

Error: Could not resolve a module for a custom reporter.
  Module name: jest-junit
    at options.reporters.reporters.map.reporterConfig (/usr/local/lib/node_modules/selenium-side-runner/node_modules/jest-config/build/normalize.js:464:15)
    at Array.map (<anonymous>)
    at normalizeReporters (/usr/local/lib/node_modules/selenium-side-runner/node_modules/jest-config/build/normalize.js:447:33)
    at normalize (/usr/local/lib/node_modules/selenium-side-runner/node_modules/jest-config/build/normalize.js:534:5)
    at readConfig (/usr/local/lib/node_modules/selenium-side-runner/node_modules/jest-config/build/index.js:163:46)
    at readConfigs (/usr/local/lib/node_modules/selenium-side-runner/node_modules/jest-config/build/index.js:372:26)
    at /usr/local/lib/node_modules/selenium-side-runner/node_modules/@jest/core/build/cli/index.js:155:58
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/usr/local/lib/node_modules/selenium-side-runner/node_modules/@jest/core/build/cli/index.js:108:24)
    at _next (/usr/local/lib/node_modules/selenium-side-runner/node_modules/@jest/core/build/cli/index.js:128:9)
tourdedave commented 5 years ago

Unable to reproduce locally. Will need to look into it further.

tourdedave commented 5 years ago

@shansb-dev Does this issue happen in the version 3.12.1 of the runner?

ferrisbuhler commented 4 years ago

The problem still exists, no matter if --debug is applied or not. Which nodejs version is recommended?

My environment: node --version v8.11.3 selenium-side-runner -V 3.16.0 jest --version 25.1.0

ferrisbuhler commented 4 years ago

Updating to nodejs 12 solved the problem.