WDIO-CLI: Could not find job
See original GitHub issue[//]: # NOTE: This repository only maintains packages that are listed in the Readme. Please make sure that your issue is directly caused by one of these packages and if not file an issue in the correct 3rd party package repository.
Environment (please complete the following information):
- WebdriverIO version: 7.0.9
- Mode: WDIO Testrunner
- If WDIO Testrunner, running sync/async: sync
- Node.js version: 12
- NPM version: 6.14.9
- Browser name and version: Chrome 87 Config of WebdriverIO An example of how you configured WebdriverIO config
Describe the bug When I run cucumber test with specific tags, all my feature files will be parsed to check if tags is present. If not, spec files are SKIPPED. After upgrading to wdio7, we have the same behavior, but my job will fail before parsing all files with exception:
/home/circleci/project/e2e_jt_tests/node_modules/@wdio/cli/build/interface.js:142 throw new Error('Could not find job'); ^ Error: Could not find job at WDIOCLInterface.clearJob (/home/circleci/project/e2e_jt_tests/node_modules/@wdio/cli/build/interface.js:142:19) at WDIOCLInterface.emit (events.js:314:20) at WDIOCLInterface.EventEmitter.emit (domain.js:483:12) at Launcher.endHandler (/home/circleci/project/e2e_jt_tests/node_modules/@wdio/cli/build/launcher.js:356:28) at WorkerInstance.emit (events.js:314:20) at WorkerInstance.EventEmitter.emit (domain.js:483:12) at WorkerInstance._handleExit (/home/circleci/project/e2e_jt_tests/node_modules/@wdio/local-runner/build/worker.js:128:14) at ChildProcess.emit (events.js:314:20) at ChildProcess.EventEmitter.emit (domain.js:483:12) at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Tests are running on CircleCI with maxInstance 30. Before upgrading to wdio7, no issues, tests were skipped until finding a test to run. Now, It seems that if every executor find a skipped test, job is failing with exception.
Issue seems to happen in interface.js file from @wdio/cli
clearJob({ cid, passed, retries }) { const job = this._jobs.get(cid); this._jobs.delete(cid); const retryAttempts = this._specFileRetries - retries; const retry = !passed && retries > 0; if (!retry) { this.result.finished++; } if (job && job.hasTests === false) { return this.onSpecSkip(cid, job); } if (!job) { throw new Error('Could not find job'); }
I don’t have a local project to reproduce as it only happens with parallel execution on the CI 😕 But I was wondering if the part of code is new on wdio7? And how should we interpret it ?
This is my cucumberOpts to run my tests:
cucumberOpts: { require: ['src/step-definitions/**/*.js'], // <string[]> (file/dir) require files before executing features backtrace: false, // <boolean> show full backtrace for errors compiler: [], // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable) dryRun: false, // <boolean> invoke formatters without executing steps failFast: false, // <boolean> abort the run on first failure format: ['pretty'], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable) colors: true, // <boolean> disable colors in formatter output snippets: true, // <boolean> hide step definition snippets for pending steps source: true, // <boolean> hide source uris profile: [], // <string[]> (name) specify the profile to use strict: false, // <boolean> fail if there are any undefined or pending steps tagExpression: CUCUMBER_TAGS ?
(${DEFAULT_CUCUMBER_TAGS}) and (${CUCUMBER_TAGS}) : DEFAULT_CUCUMBER_TAGS, // <string> (expression) // only execute the features or scenarios with tags matching the expression timeout: CUCUMBER_STEPS_TIMEOUT, // <number> timeout for step definitions ignoreUndefinedDefinitions: false, // <boolean> Enable this config to treat undefined definitions as warnings. scenarioLevelReporter: false, // Enable this to make webdriver.io behave as if scenarios and not steps were the tests. },
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
@osmolyar has also mentioned that in the Gitter channel. She is creating an issue for it. We can release a fix for it tomorrow.
@rejieshr this is a pretty old issue, please update all your WebdriverIO dependencies and retry.