stryker-js: Process Hanging on large project

Summary

Hi. I’m working on a fairly large Typescript project (~1000 files, ~half being test files) with ~5000 tests and I’m trying to get Stryker running. When I try to add too many files to be mutated the number of mutants gets to a point that the process seems to just sit there grinding away on nothing for hours. The last output I see on screen is “40055 Mutant(s) generated”. The Node process doesn’t seem to be stuck as it’s using up CPU cycles and memory usage changes. I just never get to the next step where it fires up the TestRunners and starts the real work. Do I just have to wait it out?

Even if I try to lower the number of files to be mutated down so that ~20000 mutants are generated it still hangs… the largest number of mutants generated I’ve seen run is around 13000. The project is private so I can’t share much, but hopefully there’s a solution. I fully expect this to take a long time. It will be run on a CI instance over the weekend once I can get it working.

Any help would be appreciated.

Stryker config

I’ve tried with and without the transpiler and I don’t see a difference. Aside from being able to do coverageAnalysis, but that has other issues for me.

module.exports = function (config)
{
	config.set({
		mutator: "typescript",
		packageManager: "npm",
		reporters: ["html", "clear-text", 'progress'],
		testRunner: "mocha",
		//transpilers: ["typescript"],
		testFramework: "mocha",
		coverageAnalysis: "off",
		tsconfigFile: "tsconfig.json",
		mutate: [
			"ts/**/!(*.tests).ts",
		],
		files: ["ts/**/*.ts", "lib/**/*.js"],
		mochaOptions: {
			require: [
				"ts-node/register",
				"reflect-metadata",
			],
			timeout: 0,
			files: ["ts/**/*.tests.ts"]
		}
	});
};

Stryker environment

+-- stryker@0.33.2
+-- stryker-api@0.22.1
+-- stryker-baseline-reporter@1.0.3
+-- stryker-html-reporter@0.16.10
+-- stryker-mocha-framework@0.13.3
+-- stryker-mocha-runner@0.15.3
+-- stryker-typescript@0.16.2
+-- mocha@5.2.0

System Environment

software version(s)
node 8.10.0
npm 5.6.0
Operating System windows 10 (CI on windows 2012 R2)

stryker.log

16:31:53 (31620) INFO ConfigReader Using stryker.conf.js in the current working directory.
16:31:53 (31620) DEBUG PluginLoader Loading stryker-* from C:\...\node_modules
16:31:53 (31620) DEBUG Stryker Using config: {"logLevel":"info","fileLogLevel":"trace","timeoutMS":5000,"timeoutFactor":1.5,"plugins":["stryker-*"],"port":9234,"reporter":[],"reporters":["html","clear-text","progress"],"coverageAnalysis":"off","testRunner":"mocha","mutator":"typescript","transpilers":[],"maxConcurrentTestRunners":6,"symlinkNodeModules":true,"thresholds":{"break":null,"high":80,"low":60},"allowConsoleColors":true,"packageManager":"npm","testFramework":"mocha","tsconfigFile":"tsconfig.json","mutate":["ts/**/!(*.tests).ts"],"files":["ts/**/*.ts","lib/**/*.js"],"mochaOptions":{"require":["ts-node/register","reflect-metadata"],"timeout":0,"files":["ts/**/*.tests.ts"]},"configFile":"stryker.conf.js","tsconfig":{"options":{"removeComments":true,"sourceMap":true,"target":1,"noImplicitAny":true,"module":1,"declaration":true,"noEmitOnError":true,"preserveConstEnums":true,"typeRoots":["C:/.../node_modules/@types","C:/.../node_modules"],"emitDecoratorMetadata":true,"types":["reflect-metadata","jquery","jqueryui","datejs"],"experimentalDecorators":true,"lib":["lib.es2017.d.ts","lib.dom.d.ts"],"configFilePath":"C:/.../tsconfig.json","project":"C:/...","allowUnreachableCode":true,"noUnusedLocals":false,"noUnusedParameters":false},"fileNames":[... removed listed files ...],"typeAcquisition":{"enable":false,"include":[],"exclude":[]},"raw":{"compilerOptions":{"removeComments":true,"sourceMap":true,"target":"es5","noImplicitAny":true,"module":"commonjs","declaration":true,"noEmitOnError":true,"preserveConstEnums":true,"typeRoots":["node_modules/@types","node_modules"],"emitDecoratorMetadata":true,"types":["reflect-metadata","jquery","jqueryui","datejs"],"experimentalDecorators":true,"lib":["es2017","dom"]},"include":["./demo","./resiliency","./ts"],"exclude":["./ts/typings","node_modules"],"compileOnSave":false},"errors":[],"wildcardDirectories":{"C:/.../ts":1},"compileOnSave":false,"configFileSpecs":{"includeSpecs":["./demo","./resiliency","./ts"],"excludeSpecs":["./ts/typings","node_modules"],"validatedIncludeSpecs":["./demo","./resiliency","./ts"],"validatedExcludeSpecs":["./ts/typings","node_modules"],"wildcardDirectories":{"C:/.../ts":1}}}}
16:31:53 (31620) DEBUG ConfigReader Loading config stryker.conf.js
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-baseline-reporter (matched with expression stryker-*)
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-html-reporter (matched with expression stryker-*)
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-javascript-mutator (matched with expression stryker-*)
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-mocha-framework (matched with expression stryker-*)
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-mocha-runner (matched with expression stryker-*)
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-typescript (matched with expression stryker-*)
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-baseline-reporter
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-html-reporter
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-javascript-mutator
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-mocha-framework
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-mocha-runner
16:31:53 (31620) DEBUG PluginLoader Loading plugins stryker-typescript
16:31:53 (31620) DEBUG MochaOptionsLoader No mocha opts file found, not loading additional mocha options (mochaOptions.opts was not defined).
16:31:53 (31620) INFO TypescriptConfigEditor Loading tsconfig file C:\...\tsconfig.json
16:31:53 (31620) DEBUG TestFrameworkOrchestrator The `coverageAnalysis` setting is "off", not hooking into the test framework to achieve performance benefits.
16:31:54 (31620) INFO InputFileResolver Found 477 of 1033 file(s) to be mutated.
16:31:54 (31620) DEBUG InputFileResolver All input files: [
... removed listed files ...
]
16:31:54 (31620) DEBUG InputFileResolver Files to mutate: [
... removed listed files ...
]
16:31:54 (31620) INFO InitialTestExecutor Starting initial test run. This may take a while.
16:31:54 (31620) DEBUG Sandbox Creating a sandbox for files in C:\...\.stryker-tmp\sandbox9959195
16:31:54 (31620) DEBUG Sandbox Creating test runner 0 using settings {port: 9234}
16:31:54 (31620) DEBUG ChildProcessProxy Starting C:\...\node_modules\stryker\src\test-runner\ChildProcessTestRunnerWorker.js in child process 4196
16:31:55 (31620) DEBUG TimeoutDecorator Starting timeout timer (300000 ms) for a test run
16:31:54 (4196) DEBUG PluginLoader Loading stryker-* from C:\...\node_modules
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-baseline-reporter (matched with expression stryker-*)
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-html-reporter (matched with expression stryker-*)
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-javascript-mutator (matched with expression stryker-*)
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-mocha-framework (matched with expression stryker-*)
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-mocha-runner (matched with expression stryker-*)
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-typescript (matched with expression stryker-*)
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-baseline-reporter
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-html-reporter
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-javascript-mutator
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-mocha-framework
16:31:54 (4196) DEBUG PluginLoader Loading plugins stryker-mocha-runner
16:31:55 (4196) DEBUG PluginLoader Loading plugins stryker-typescript
16:31:55 (4196) DEBUG ChildProcessProxyWorker Changing current working directory for this process to C:\...\.stryker-tmp\sandbox9959195
16:31:55 (4196) DEBUG MochaTestRunner Using files: [
... removed listed files ...
]
16:31:58 (4196) DEBUG StrykerMochaReporter Starting Mocha test run
16:32:05 (31620) TRACE ChildProcessProxy handleOrientationChange

16:32:05 (31620) TRACE ChildProcessProxy handleOrientationChange

16:32:05 (31620) TRACE ChildProcessProxy getChildIds did not return an array. Removing all child items.

16:32:14 (4196) DEBUG StrykerMochaReporter Mocha test run completed: 5029/5029 passed
16:32:14 (31620) DEBUG ChildProcessProxy Disposing of worker process 4196
16:32:14 (31620) DEBUG ChildProcessProxy Kill 4196

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Yes but not such a good experience. I am discussing my progress in hopes that some others will start watching, experimenting, and contributing ideas to help us all find a good solution.

I have a feeling (and nothing more than a feeling) that Stryker could use some improvement in resource allocation and usage. I think it should be possible to break things into separate worker threads or processes that can work together through promises.

I also have a feeling that Node.js could be a little smarter about using the system resources available.

I will continue to experiment and explore as much as I can on this behavior.

@brodybits It makes sense tho, since we store quite a lot of data, it may weight a lot. But 1.7GB, I dunno. There should be some tools to check how much data is used. I am really looking for your results!

Nice resources, thanks! I am still quite new with Stryker, not sure when I will get to do much more investigation.

Sent from my mobile