Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test runner process ran out of memory #2641

Closed
jonathan-dev opened this issue Dec 3, 2020 · 9 comments
Closed

test runner process ran out of memory #2641

jonathan-dev opened this issue Dec 3, 2020 · 9 comments
Labels
🐛 Bug Something isn't working

Comments

@jonathan-dev
Copy link

Summary

I found the way I implemented a string concatenation function causes stryker to run out of memory.
function causing the problem:

function printBoard( board) {
	console.log('\n' +
	' ' + board[1] + ' | ' + board[2] + ' | ' + board[3] + '\n' +
	' ---------\n' +
	' ' + board[4] + ' | ' + board[5] + ' | ' + board[6] + '\n' +
	' ---------\n' +
	' ' + board[7] + ' | ' + board[8] + ' | ' + board[9] + '\n');
}

error produced:

$ stryker run
15:23:20 (112662) INFO ConfigReader Using stryker.conf.json
15:23:20 (112662) INFO InputFileResolver Found 1 of 13 file(s) to be mutated.
15:23:23 (112662) INFO Instrumenter Instrumented 1 source file(s) with 134 mutant(s)
15:23:23 (112662) INFO ConcurrencyTokenProvider Creating 4 test runner process(es).
15:23:23 (112662) INFO DryRunExecutor Starting initial test run. This may take a while.
15:27:10 (112662) WARN ChildProcessProxy Child process [pid 112682] ran out of memory. Stdout and stderr are logged on debug level.
15:27:10 (112662) INFO RetryDecorator Test runner process [112682] ran out of memory. You probably have a memory leak in your tests. Don't worry, Stryker will restart the process, but you might want to investigate this later, because this decreases performance.
15:30:26 (112662) WARN ChildProcessProxy Child process [pid 112891] ran out of memory. Stdout and stderr are logged on debug level.
15:30:26 (112662) INFO RetryDecorator Test runner process [112891] ran out of memory. You probably have a memory leak in your tests. Don't worry, Stryker will restart the process, but you might want to investigate this later, because this decreases performance.
15:30:27 (112662) ERROR DryRunExecutor One or more tests resulted in an error:
Test runner crashed. Tried twice to restart it without any luck. Last time the error message was: Error: Process 
Error: Process 
at ChildProcessProxy.handleUnexpectedExit (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/child-proxy/child-process-proxy.js:27:37)
at ChildProcess.emit (events.js:209:13)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
15:30:27 (112662) ERROR Stryker Error: Something went wrong in the initial test run
at DryRunExecutor.validateResultCompleted (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:64:15)
at DryRunExecutor.timeDryRun (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:72:14)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async DryRunExecutor.execute (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:37:42)
at async Stryker.runMutationTest (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/stryker.js:36:53)
15:30:27 (112662) INFO Stryker Trouble figuring out what went wrong? Try `npx stryker run --fileLogLevel trace --logLevel debug` to get some more info.
error Command failed with exit code 1.

changing the function to this fixes the problem:

function printBoard( board) {
	console.log(['\n' ,
	' ' , board[1] , ' | ' , board[2] , ' | ' , board[3] , '\n' ,
	' ---------\n' ,
	' ' , board[4] , ' | ' , board[5] , ' | ' , board[6] , '\n' ,
	' ---------\n' ,
	' ' , board[7] , ' | ' , board[8] , ' | ' , board[9] , '\n'].join(''));
}

but since it is undesirable to have to do those kinds of refactorings I wanted to file a bug report.

Stryker config

{
  "$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
  "packageManager": "yarn",
  "mutate": [
    "src/**/*.js",
    "!src/index.js"
  ],
  "reporters": [
    "clear-text",
    "progress"
  ],
  "testRunner": "jest",
  "coverageAnalysis": "off"
}

Test runner config

default

Stryker environment

"@stryker-mutator/core": "^4.1.2",
"@stryker-mutator/jest-runner": "^4.1.2",
"jest": "^26.6.3"

Test runner environment

# Test command
stryker run

Your Environment

software version(s)
node v12.9.1
npm 6.14.8
Operating System Arch linux

Add stryker.log

11:14:42 (292912) INFO ConfigReader Using stryker.conf.json
11:14:42 (292912) DEBUG BroadcastReporter Broadcasting to reporters ["clear-text","progress"]
11:14:42 (292912) DEBUG ConfigReader Loading config /home/jo/uibk/sq/stryker.conf.json
11:14:42 (292912) DEBUG ConfigReader Loaded config: {
  "$schema": "./node_modules/@stryker-mutator/core/schema/stryker-schema.json",
  "packageManager": "yarn",
  "mutate": [
    "src/**/*.js",
    "!src/index.js"
  ],
  "reporters": [
    "clear-text",
    "progress"
  ],
  "testRunner": "jest",
  "coverageAnalysis": "off",
  "allowConsoleColors": true,
  "checkers": [],
  "maxTestRunnerReuse": 0,
  "commandRunner": {
    "command": "npm test"
  },
  "clearTextReporter": {
    "allowColor": true,
    "logTests": true,
    "maxTestsToLog": 3
  },
  "dashboard": {
    "baseUrl": "https://dashboard.stryker-mutator.io/api/reports",
    "reportType": "full"
  },
  "eventReporter": {
    "baseDir": "reports/mutation/events"
  },
  "fileLogLevel": "trace",
  "logLevel": "info",
  "maxConcurrentTestRunners": 9007199254740991,
  "mutator": {
    "plugins": null,
    "excludedMutations": []
  },
  "plugins": [
    "@stryker-mutator/*"
  ],
  "appendPlugins": [],
  "disableTypeChecks": "{test,src,lib}/**/*.{js,ts,jsx,tsx,html,vue}",
  "symlinkNodeModules": true,
  "tempDirName": ".stryker-tmp",
  "cleanTempDir": true,
  "thresholds": {
    "high": 80,
    "low": 60,
    "break": null
  },
  "timeoutFactor": 1.5,
  "timeoutMS": 5000,
  "tsconfigFile": "tsconfig.json",
  "warnings": true,
  "configFile": "/home/jo/uibk/sq/stryker.conf.json"
}
11:14:42 (292912) DEBUG PluginLoader Loading @stryker-mutator/* from /home/jo/uibk/sq/node_modules/@stryker-mutator
11:14:42 (292912) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter" (matched with expression @stryker-mutator/*)
11:14:42 (292912) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner" (matched with expression @stryker-mutator/*)
11:14:42 (292912) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter
11:14:42 (292912) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner
11:14:42 (292912) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/reporters/index.js
11:14:42 (292912) DEBUG buildSchemaWithPluginContributions Contributing 1 schemas from plugins to options validation.
11:14:42 (292912) INFO InputFileResolver Found 1 of 14 file(s) to be mutated.
11:14:42 (292912) DEBUG InputFileResolver All input files: [
  "/home/jo/uibk/sq/.gitignore",
  "/home/jo/uibk/sq/ASQ_ExamProjectDescription.pdf",
  "/home/jo/uibk/sq/Perceived+Usefulness_+Perceived+Ease+of+Use_+and+User+Acceptance+of+Information+Technology.pdf",
  "/home/jo/uibk/sq/__test__/ttt.test.js",
  "/home/jo/uibk/sq/package.json",
  "/home/jo/uibk/sq/seminar_report/img/uni-innsbruck.pdf",
  "/home/jo/uibk/sq/seminar_report/img/uni-watermark.pdf",
  "/home/jo/uibk/sq/seminar_report/references.bib",
  "/home/jo/uibk/sq/seminar_report/seminarpaper.tex",
  "/home/jo/uibk/sq/seminar_report/titlepage.tex",
  "/home/jo/uibk/sq/src/index.js",
  "/home/jo/uibk/sq/src/ttt.js",
  "/home/jo/uibk/sq/stryker.conf.json",
  "/home/jo/uibk/sq/yarn.lock"
]
11:14:42 (292912) DEBUG InputFileResolver Files to mutate: [
  "/home/jo/uibk/sq/src/ttt.js"
]
11:14:42 (292912) DEBUG TemporaryDirectory Using temp directory "/home/jo/uibk/sq/.stryker-tmp"
11:14:42 (292912) DEBUG Instrumenter Instrumenting 1 source files with mutants
11:14:45 (292912) DEBUG Instrumenter Instrumented src/ttt.js (134 mutant(s))
11:14:45 (292912) INFO Instrumenter Instrumented 1 source file(s) with 134 mutant(s)
11:14:45 (292912) INFO ConcurrencyTokenProvider Creating 4 test runner process(es).
11:14:45 (292912) DEBUG Sandbox Creating a sandbox for files in /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292912) DEBUG ChildProcessProxy Starting /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/test-runner/child-process-test-runner-worker.js in child process 292934
11:14:45 (292912) DEBUG ChildProcessProxy Starting /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/test-runner/child-process-test-runner-worker.js in child process 292941
11:14:45 (292941) DEBUG ChildProcessProxyWorker Changing current working directory for this process to /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292941) DEBUG PluginLoader Loading @stryker-mutator/* from /home/jo/uibk/sq/node_modules/@stryker-mutator
11:14:45 (292941) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter" (matched with expression @stryker-mutator/*)
11:14:45 (292941) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner" (matched with expression @stryker-mutator/*)
11:14:45 (292941) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter
11:14:45 (292941) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner
11:14:45 (292941) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/reporters/index.js
11:14:45 (292941) DEBUG CustomJestConfigLoader Read Jest config from /home/jo/uibk/sq/.stryker-tmp/sandbox2470268/package.json
11:14:45 (292912) DEBUG ChildProcessProxy Starting /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/test-runner/child-process-test-runner-worker.js in child process 292956
11:14:45 (292912) INFO DryRunExecutor Starting initial test run. This may take a while.
11:14:45 (292912) DEBUG TimeoutDecorator Starting timeout timer (300000 ms) for a test run
11:14:45 (292941) DEBUG JestTestRunner Merging file-based config {} 
      with custom config {}
      and default (internal) stryker config [object Object]
11:14:45 (292941) DEBUG JestTestRunner Running jest with --findRelatedTests flag. Set jest.enableFindRelatedTests to false to run all tests on every mutant.
11:14:45 (292941) DEBUG JestTestRunner Project root is /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292912) DEBUG ChildProcessProxy Starting /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/test-runner/child-process-test-runner-worker.js in child process 292963
11:14:45 (292934) DEBUG ChildProcessProxyWorker Changing current working directory for this process to /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292934) DEBUG PluginLoader Loading @stryker-mutator/* from /home/jo/uibk/sq/node_modules/@stryker-mutator
11:14:45 (292934) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter" (matched with expression @stryker-mutator/*)
11:14:45 (292934) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner" (matched with expression @stryker-mutator/*)
11:14:45 (292934) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter
11:14:45 (292934) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner
11:14:45 (292934) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/reporters/index.js
11:14:45 (292934) DEBUG CustomJestConfigLoader Read Jest config from /home/jo/uibk/sq/.stryker-tmp/sandbox2470268/package.json
11:14:45 (292934) DEBUG JestTestRunner Merging file-based config {} 
      with custom config {}
      and default (internal) stryker config [object Object]
11:14:45 (292934) DEBUG JestTestRunner Running jest with --findRelatedTests flag. Set jest.enableFindRelatedTests to false to run all tests on every mutant.
11:14:45 (292934) DEBUG JestTestRunner Project root is /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292934) TRACE JestGreaterThan25Adapter Invoking Jest with config {"collectCoverage":false,"verbose":false,"bail":false,"notify":false,"rootDir":"/home/jo/uibk/sq/.stryker-tmp/sandbox2470268","reporters":[]}
11:14:45 (292956) DEBUG ChildProcessProxyWorker Changing current working directory for this process to /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292956) DEBUG PluginLoader Loading @stryker-mutator/* from /home/jo/uibk/sq/node_modules/@stryker-mutator
11:14:45 (292956) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter" (matched with expression @stryker-mutator/*)
11:14:45 (292956) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner" (matched with expression @stryker-mutator/*)
11:14:45 (292956) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter
11:14:46 (292956) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner
11:14:46 (292956) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/reporters/index.js
11:14:46 (292956) DEBUG CustomJestConfigLoader Read Jest config from /home/jo/uibk/sq/.stryker-tmp/sandbox2470268/package.json
11:14:46 (292956) DEBUG JestTestRunner Merging file-based config {} 
      with custom config {}
      and default (internal) stryker config [object Object]
11:14:46 (292956) DEBUG JestTestRunner Running jest with --findRelatedTests flag. Set jest.enableFindRelatedTests to false to run all tests on every mutant.
11:14:46 (292956) DEBUG JestTestRunner Project root is /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292963) DEBUG ChildProcessProxyWorker Changing current working directory for this process to /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:14:45 (292963) DEBUG PluginLoader Loading @stryker-mutator/* from /home/jo/uibk/sq/node_modules/@stryker-mutator
11:14:45 (292963) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter" (matched with expression @stryker-mutator/*)
11:14:45 (292963) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner" (matched with expression @stryker-mutator/*)
11:14:45 (292963) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter
11:14:46 (292963) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner
11:14:46 (292963) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/reporters/index.js
11:14:46 (292963) DEBUG CustomJestConfigLoader Read Jest config from /home/jo/uibk/sq/.stryker-tmp/sandbox2470268/package.json
11:14:46 (292963) DEBUG JestTestRunner Merging file-based config {} 
      with custom config {}
      and default (internal) stryker config [object Object]
11:14:46 (292963) DEBUG JestTestRunner Running jest with --findRelatedTests flag. Set jest.enableFindRelatedTests to false to run all tests on every mutant.
11:14:46 (292963) DEBUG JestTestRunner Project root is /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:19:45 (292912) DEBUG TimeoutDecorator Timeout expired, restarting the process and reporting timeout
11:19:48 (292912) DEBUG ChildProcessProxy Disposing of worker process 292934
11:19:50 (292912) DEBUG ChildProcessProxy Kill 292934
11:19:54 (292912) DEBUG ChildProcessProxy Starting /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/test-runner/child-process-test-runner-worker.js in child process 293261
11:19:55 (292912) ERROR DryRunExecutor Initial test run timed out!
11:19:55 (292912) DEBUG Stryker Not removing the temp dir because an error occurred
11:19:55 (292912) ERROR Stryker Error: Something went wrong in the initial test run
    at DryRunExecutor.validateResultCompleted (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:64:15)
    at DryRunExecutor.timeDryRun (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:72:14)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
    at async DryRunExecutor.execute (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:37:42)
    at async Stryker.runMutationTest (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/stryker.js:36:53)
11:19:55 (292912) DEBUG ChildProcessProxy Disposing of worker process 293261
11:19:54 (293261) DEBUG ChildProcessProxyWorker Changing current working directory for this process to /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:19:54 (293261) DEBUG PluginLoader Loading @stryker-mutator/* from /home/jo/uibk/sq/node_modules/@stryker-mutator
11:19:54 (293261) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter" (matched with expression @stryker-mutator/*)
11:19:54 (293261) DEBUG PluginLoader Loading plugin "/home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner" (matched with expression @stryker-mutator/*)
11:19:54 (293261) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/instrumenter
11:19:55 (293261) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/jest-runner
11:19:55 (293261) DEBUG PluginLoader Loading plugins /home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/reporters/index.js
11:19:55 (293261) DEBUG CustomJestConfigLoader Read Jest config from /home/jo/uibk/sq/.stryker-tmp/sandbox2470268/package.json
11:19:55 (292912) DEBUG ChildProcessProxy Disposing of worker process 292956
11:19:55 (292912) DEBUG ChildProcessProxy Disposing of worker process 292941
11:19:55 (292912) DEBUG ChildProcessProxy Disposing of worker process 292963
11:19:55 (292912) DEBUG ChildProcessProxy Kill 293261
11:19:55 (293261) DEBUG JestTestRunner Merging file-based config {} 
      with custom config {}
      and default (internal) stryker config [object Object]
11:19:55 (293261) DEBUG JestTestRunner Running jest with --findRelatedTests flag. Set jest.enableFindRelatedTests to false to run all tests on every mutant.
11:19:55 (293261) DEBUG JestTestRunner Project root is /home/jo/uibk/sq/.stryker-tmp/sandbox2470268
11:19:55 (292912) DEBUG ChildProcessProxy Kill 292956
11:19:55 (292912) DEBUG ChildProcessProxy Kill 292941
11:19:55 (292912) DEBUG ChildProcessProxy Kill 292963
@jonathan-dev jonathan-dev added the 🐛 Bug Something isn't working label Dec 3, 2020
@nicojs
Copy link
Member

nicojs commented Dec 3, 2020

Thanks for opening this issue. Why did you conclude it is an out-of-memory (OOM) error? I don't see this explicitly.

@jonathan-dev
Copy link
Author

because it said so here:

$ stryker run
15:23:20 (112662) INFO ConfigReader Using stryker.conf.json
15:23:20 (112662) INFO InputFileResolver Found 1 of 13 file(s) to be mutated.
15:23:23 (112662) INFO Instrumenter Instrumented 1 source file(s) with 134 mutant(s)
15:23:23 (112662) INFO ConcurrencyTokenProvider Creating 4 test runner process(es).
15:23:23 (112662) INFO DryRunExecutor Starting initial test run. This may take a while.
15:27:10 (112662) WARN ChildProcessProxy Child process [pid 112682] ran out of memory. Stdout and stderr are logged on debug level.
15:27:10 (112662) INFO RetryDecorator Test runner process [112682] ran out of memory. You probably have a memory leak in your tests. Don't worry, Stryker will restart the process, but you might want to investigate this later, because this decreases performance.
15:30:26 (112662) WARN ChildProcessProxy Child process [pid 112891] ran out of memory. Stdout and stderr are logged on debug level.
15:30:26 (112662) INFO RetryDecorator Test runner process [112891] ran out of memory. You probably have a memory leak in your tests. Don't worry, Stryker will restart the process, but you might want to investigate this later, because this decreases performance.
15:30:27 (112662) ERROR DryRunExecutor One or more tests resulted in an error:
Test runner crashed. Tried twice to restart it without any luck. Last time the error message was: Error: Process 
Error: Process 
at ChildProcessProxy.handleUnexpectedExit (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/child-proxy/child-process-proxy.js:27:37)
at ChildProcess.emit (events.js:209:13)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
15:30:27 (112662) ERROR Stryker Error: Something went wrong in the initial test run
at DryRunExecutor.validateResultCompleted (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:64:15)
at DryRunExecutor.timeDryRun (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:72:14)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async DryRunExecutor.execute (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/process/3-dry-run-executor.js:37:42)
at async Stryker.runMutationTest (/home/jo/uibk/sq/node_modules/@stryker-mutator/core/src/stryker.js:36:53)
15:30:27 (112662) INFO Stryker Trouble figuring out what went wrong? Try `npx stryker run --fileLogLevel trace --logLevel debug` to get some more info.
error Command failed with exit code 1.

@nicojs
Copy link
Member

nicojs commented Dec 3, 2020

Ah yes, sorry, didn't read the log properly 😅

Interesting will take a look.

@Garethp
Copy link
Contributor

Garethp commented Dec 7, 2020

From quick testing, it looks like the way the instrumentor takes care of string concatenation is by recognizing the concat operator (+) as a binary arithmetic operator and tries to add mutants by swapping it out for -. This means that the mutated code gets exponentially larger when you have multiple strings being concatenated. The example function of printBoard outputs a 25MB file that causes out of memory issues when trying to parse the syntax.

I believe that we should be able to solve this by trying to detect when a binary expression is a string concatenation rather than an arithmetic operation. We can do this by walking through the entire left tree of a BinaryExpression looking at both right and left nodes, and once we detect that any of them are strings we can decide not to do any arithmetic operations on it. Ticket #2646 should solve this, and hopefully that will solve the out of memory error

@jonathan-dev
Copy link
Author

From quick testing, it looks like the way the instrumentor takes care of string concatenation is by recognizing the concat operator (+) as a binary arithmetic operator and tries to add mutants by swapping it out for -. This means that the mutated code gets exponentially larger when you have multiple strings being concatenated. The example function of printBoard outputs a 25MB file that causes out of memory issues when trying to parse the syntax.

I believe that we should be able to solve this by trying to detect when a binary expression is a string concatenation rather than an arithmetic operation. We can do this by walking through the entire left tree of a BinaryExpression looking at both right and left nodes, and once we detect that any of them are strings we can decide not to do any arithmetic operations on it. Ticket #2646 should solve this, and hopefully that will solve the out of memory error

I was expecting that to happen internally. Good to hear that you are already working on it.

@nicojs
Copy link
Member

nicojs commented Dec 8, 2020

Ticket #2646 should solve this, and hopefully, that will solve the out of memory error

I would say solving the OOM error for this particular case can be a side effect of #2646. The root cause of the OOM error can hopefully be found and solved at https://github.com/stryker-mutator/stryker/blob/f3a177df401ed252401643ddc87d45f21ab071ee/packages/instrumenter/src/mutant-placers/expression-mutant-placer.ts#L53

@nicojs
Copy link
Member

nicojs commented Jul 29, 2021

@jonathan-dev quite a lot has changed since December. Notably, since 5.2 we've improved our mutant placing algorithm. Are you still experiencing OOM errors?

@DanielLepszy
Copy link

DanielLepszy commented Jan 12, 2022

I see, the ticket is still in opened status but the concatenation probably was fixed in #2648
Am I right or you guys still working on that?

@nicojs
Copy link
Member

nicojs commented Jun 23, 2022

Yes definitely. We've also since fixed the root cause in #2964

@DanielLepszy thanks for pointing that out 🙏

@nicojs nicojs closed this as completed Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants