0

简单地运行“stryker run”,正在创建突变并且一切似乎都运行顺利,直到我收到空运行失败的错误:

22:19:29 (12628) DEBUG JestTestRunner Running jest with --findRelatedTests flag. Set jest.enableFindRelatedTests to false to run all tests on every mutant.
22:24:17 (9652) DEBUG TimeoutDecorator Timeout expired, restarting the process and reporting timeout
22:24:19 (9652) DEBUG ChildProcessProxy Disposing of worker process 12952
22:24:21 (9652) DEBUG ChildProcessProxy Kill 12952
22:24:26 (9652) DEBUG ChildProcessProxy Started ChildProcessTestRunnerWorker in child process 20336
22:24:38 (9652) ERROR DryRunExecutor Initial test run timed out!
22:24:38 (9652) DEBUG Stryker Not removing the temp dir because an error occurred
22:24:38 (9652) ERROR Stryker Unexpected error occurred while running Stryker Error: Something went wrong in the initial test run
    at DryRunExecutor.validateResultCompleted (C:\Users\avalchev\IdeaProjects\project\node_modules\@stryker-mutator\core\dist\src\process\3-dry-run-executor.js:61:15)
    at DryRunExecutor.timeDryRun (C:\Users\avalchev\IdeaProjects\project\node_modules\@stryker-mutator\core\dist\src\process\3-dry-run-executor.js:71:14)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async C:\Users\avalchev\IdeaProjects\project\node_modules\@stryker-mutator\core\dist\src\concurrent\pool.js:62:28

请记住,当我的配置为真时,我收到 Set jest.enableFindRelatedTests 为假。如果我将其设置为 false,调试器会说 Set jest.enableFindRelatedTests 为 true。所以这就是为什么我把它全部删除

这是我的配置:

/**
 * @type {import('@stryker-mutator/api/core').StrykerOptions}
 */
module.exports = {
  _comment:
     "This config was generated using 'stryker init'. Please see the guide for more information: https://stryker-mutator.io/docs/stryker-js/guides/angular",
  mutate: [
    "*/.ts",
    "!**/*.spec.ts",
    "!**/*test.ts"
  ],
  testRunner: "jest",
  "jest": {
    "projectType": "custom",
    "configFile": "jest.config.js",
    "config": {
      "testEnvironment": "jest-environment-jsdom-sixteen"
    }
  },
  tempDirName: "stryker-tmp",
  reporters: ["progress", "clear-text", "html"],
  concurrency: 4,
  concurrency_comment:
     "Recommended to use about half of your available cores when running stryker with angular",
  coverageAnalysis: "perTest",
};
4

1 回答 1

0

在 Stryker 配置文件中,我添加了timeoutMS设置以增加每个测试使用的时间。我将其设置为 30 秒(30000)。

timeoutMS: 30000   // Use extended timeoutMs for test run to remove Time Out Results
于 2021-06-25T14:37:02.720 回答