webdriverio: Jenkins Jobs Hang with 4.11 but not with 4.10.2

The problem

When running our Jenkins file with Web Driver 4.11 we get stuck in a hang with the cat command open. Things work fine with 4.10.2.

Environment

  • WebdriverIO version: 4.11/4.10.2
  • Node.js version: 9.6
  • Standalone mode or wdio testrunner: standalone
  • if wdio testrunner, running synchronous or asynchronous tests:
  • Additional wdio packages used (if applicable):

Details

Describe in more detail the problem you have been experiencing, if necessary.

I’m using the Docker image: circle-ci/node:9-stretch-browsers in Jenkins. (Note: Both versions of webdriver work in the docker image, only when it is mounted on Jenkins do the issues surface. The new version does seem to hang in the base docker image if it’s used with start-server-and-test.)


    "e2e:ci": "E2E_MODE=ci BASE_URL=http://localhost:5000 ./node_modules/.bin/wdio ./e2e/wdio.conf.js",
    "e2e:start-ci": "start-server-and-test start:server http://localhost:5000 e2e:ci",

When running ./node_modules/.bin/wdio --version, it correctly returns the version in both cases.

Running ./node_modules/webdriverio/bin/wdio ./e2e/wdio.conf.js hangs. Our config file starts with

let capabilities = [];
let services = [];
let sauceUser = '';
let sauceKey = '';
console.log('config');

The console.log is never printed.

I know some changes were made with argv and I’m wondering if https://github.com/webdriverio/webdriverio/compare/v4.10.2...v4.11.0#diff-f8849ae9f0614ba9464fdd14c2d98dc0L437 might be related and causing it to wait for input off stdin for some reason.

I’m happy to help debug. No logs seem to be generated before the hang.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 8
  • Comments: 35 (17 by maintainers)

Most upvoted comments

@WillBrock @christian-bromann I think wdio should behave like other unix tools, e.g. grep that do not have any internal magic to detect whether to read from an input file (given as a parameter) or from stdin. The behavior is only determined by the parameters given to the command.

From grep’s manpage:

grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name)

A short test confirms that if input is provided via a file parameter and a pipe to stdin at the same time the file parameter has the precedence:

$ echo foo.from.pipe > pipe
$ echo foo.from.file > file
$ cat pipe | grep foo file
foo.from.file

This also enforces @loren138’s point that CLI mode should be the default rather than reading from stdin.

@christian-bromann What is blocking a 4.12.1 release that would fix this issue?

Any updates on this issue? I also having the similar issue with bamboo , webdriverio 4.12.0 where is stuck and hang at onPrepare hook.

+1 from me to get this resolved. Prevents us from upgrading beyond 4.10.2

We are observing a very similar behavior. Starting with version 4.11 wdio hangs when executed from IntelliJ IDEA / Webstorm.

The IntelliJ run configuration looks like this:

Working Directory: <the project directory>
JavaScript file: node_modules/.bin/wdio
Application parameters: wdio.conf.js

This is equivalent to this run configuration (in file .idea/runConfigurations/Run_wdio.xml):

<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="Run wdio" type="NodeJSConfigurationType" factoryName="Node.js" activateToolWindowBeforeRun="false" application-parameters="wdio.conf.js" path-to-js-file="node_modules/.bin/wdio" working-dir="$PROJECT_DIR$">
    <method />
  </configuration>
</component>

The only output I see in the “Run”-window is this:

/Users/me/.nvm/versions/node/v8.9.4/bin/node /Users/me/myproject/node_modules/.bin/wdio wdio.conf.js

Then the process seems to be stuck forever. On the other hand, if I run the above command from a shell it works as expected.

I also put a throw new Error('stop') at the top of wdio.conf.js but even that has no effect when executed from IntelliJ and wdio hangs so I expect that wdio.conf.js is not read at all. From a shell I see the expected stacktrace provoked by this error:

$ Failed loading configuration file: /Users/me/myproject/wdio.conf.js
/Users/me/myproject/node_modules/webdriverio/build/lib/utils/ConfigParser.js:193
                throw e;
                ^

Error: stop
    at Object.<anonymous> (/Users/me/myproject/wdio.conf.js:5:7)
    at ...

(The same applies for any console output emitted in wdio.conf.js)

If I replace the application parameter wdio.conf.js with -h or -v the help resp. version is printed even if started from IntelliJ. If I switch back to version 4.10.2 everything is fine and tests are executed normally.

FIx works with Intellij and release 4.13.1

+1 from me. Webstorm npm run doesn’t work while writing same stuff in terminal is working. 4.10.1 and 4.10.2 is working fine, 4.11 and 4.12 not