{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1998","repository_url":"https://api.github.com/repos/webdriverio/webdriverio","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1998/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1998/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1998/events","html_url":"https://github.com/webdriverio/webdriverio/issues/1998","id":223031365,"number":1998,"title":"Launcher.run() promise isn't resolved nor rejected in certain cases","user":{"login":"FennNaten","id":5120098,"avatar_url":"https://avatars3.githubusercontent.com/u/5120098?v=3","gravatar_id":"","url":"https://api.github.com/users/FennNaten","html_url":"https://github.com/FennNaten","followers_url":"https://api.github.com/users/FennNaten/followers","following_url":"https://api.github.com/users/FennNaten/following{/other_user}","gists_url":"https://api.github.com/users/FennNaten/gists{/gist_id}","starred_url":"https://api.github.com/users/FennNaten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FennNaten/subscriptions","organizations_url":"https://api.github.com/users/FennNaten/orgs","repos_url":"https://api.github.com/users/FennNaten/repos","events_url":"https://api.github.com/users/FennNaten/events{/privacy}","received_events_url":"https://api.github.com/users/FennNaten/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-20T11:10:31Z","updated_at":"2017-04-20T15:15:15Z","closed_at":"2017-04-20T13:53:48Z","body":"## The problem\r\n\r\nHi,\r\nI'm currently in the process of integrating several tools in a pre-configured cli for end-to-end testing.\r\nAs I'm heavily using node.js, I decided to go with wdio runner, using it programmatically thanks to require('webdriverio').Launcher.\r\nAs part of my integration testing, I decided to feed it invalid config (as I support users overriding my defaults, I assume they may do it wrong)\r\nAnd so, I've been able to see that while the .run() method executes (it produces console output), the promise isn't rejected. (letting my program hanging, as I have other child processes that I orchestrate after test run)\r\nThis is surprising behavior, and it's not easy to deal with it.\r\nI'm currently thinking about switching to using wdio bin as a child process instead, but it's not ideal.\r\n\r\n## Environment\r\n\r\n* WebdriverIO version: 4.4.0\r\n* Node.js version: 6.4.0\r\n* [Standalone mode or wdio testrunner](http://webdriver.io/guide/getstarted/modes.html): wdio testrunner, programmatic mode\r\n* OS: windows 8\r\n\r\n## Code To Reproduce Issue\r\n\r\nI've been able to put up a simplified case that reproduces the issue.\r\nHaving webdriverio being the only package, locally installed.\r\n\r\nwdio.common.conf.js: this conf will cause an error because the given specs don't match anything\r\n\r\n```javascript\r\nconsole.log(\"Testing from local workstation\");\r\nexports.config = {\r\n    maxInstances: 1,\r\n    capabilities: [{\r\n        maxInstances: 1,\r\n        browserName: 'chrome'\r\n    }],\r\n    waitforTimeout: 60000,\r\n    connectionRetryTimeout: 90000,\r\n    connectionRetryCount: 3,\r\n    sync: true,\r\n    logLevel: 'verbose',\r\n    coloredLogs: true,\r\n    framework: 'mocha',\r\n    reporters: ['dot'],\r\n    mochaOpts: {\r\n        ui: 'bdd',\r\n        timeout: 60000\r\n    },\r\n    specs: [\r\n        'useCases/*.js'\r\n    ]\r\n}\r\n```\r\n\r\ntest.js\r\n```javascript\r\nconst path = require('path');\r\nconst configFile = path.resolve(__dirname, './wdio.common.conf.js');\r\nconst Launcher = require('webdriverio').Launcher;\r\nconst wdio = new Launcher(configFile, {});\r\nconst handleError = (error) => {\r\n\tconsole.error('Launcher failed while running the test suite', error.stacktrace);\r\n\treturn;\r\n};\r\nconst handleSuccess = (code) => {\r\n\tconsole.log('test suite run is finished')\r\n\treturn;\r\n}\r\nwdio.run().then(handleSuccess, handleError).catch(handleError);\r\n```\r\n\r\nwhen run through `node test.js`, output is:\r\n```\r\nTesting from local workstation\r\npattern useCases/*.js did not match any file\r\n```\r\nThen process stops, promise callbacks aren't called, neither for error nor for success.\r\n\r\nedition: removed a test case that wasn't related"},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/295774132","html_url":"https://github.com/webdriverio/webdriverio/issues/1998#issuecomment-295774132","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1998","id":295774132,"user":{"login":"FennNaten","id":5120098,"avatar_url":"https://avatars3.githubusercontent.com/u/5120098?v=3","gravatar_id":"","url":"https://api.github.com/users/FennNaten","html_url":"https://github.com/FennNaten","followers_url":"https://api.github.com/users/FennNaten/followers","following_url":"https://api.github.com/users/FennNaten/following{/other_user}","gists_url":"https://api.github.com/users/FennNaten/gists{/gist_id}","starred_url":"https://api.github.com/users/FennNaten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FennNaten/subscriptions","organizations_url":"https://api.github.com/users/FennNaten/orgs","repos_url":"https://api.github.com/users/FennNaten/repos","events_url":"https://api.github.com/users/FennNaten/events{/privacy}","received_events_url":"https://api.github.com/users/FennNaten/received_events","type":"User","site_admin":false},"created_at":"2017-04-20T15:15:15Z","updated_at":"2017-04-20T15:15:15Z","body":"That was fast, thanks :) "}}
{"actor":{"display_login":"FennNaten"}}