Backstop succeeds when a child process dies
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
We ran into a problem recently where one of our comparison images was not a valid PNG. Backstop would die with the following exception:
```
events.js:112
throw er; // Unhandled 'error' event
^
Error: Unsupported compression method
at module.exports.Parser._parseIHDR (/Users/juliano/git/content-creation/elm/node_modules/node-resemble-js/node_modules/pngjs/lib/parser.js:150:16)
at module.exports.ChunkStream._processRead (/Users/juliano/git/content-creation/elm/node_modules/node-resemble-js/node_modules/pngjs/lib/chunkstream.js:174:13)
at module.exports.ChunkStream._process (/Users/juliano/git/content-creation/elm/node_modules/node-resemble-js/node_modules/pngjs/lib/chunkstream.js:193:14)
at module.exports.ChunkStream.write (/Users/juliano/git/content-creation/elm/node_modules/node-resemble-js/node_modules/pngjs/lib/chunkstream.js:61:8)
at exports.PNG.PNG.write (/Users/juliano/git/content-creation/elm/node_modules/node-resemble-js/node_modules/pngjs/lib/png.js:92:16)
at ReadStream.ondata (_stream_readable.js:646:20)
at ReadStream.emit (events.js:127:13)
at addChunk (_stream_readable.js:269:12)
at readableAddChunk (_stream_readable.js:256:11)
at ReadStream.Readable.push (_stream_readable.js:213:10)
events.js:112
```
It took a while for us to notice this because VRT kept passing on CI, the process' exit code was still 0 even tho it was failing.
We looked a bit into why this was happening and nailed it down to this bit:
https://github.com/garris/BackstopJS/blob/1ac9a02bdd57c96acc4924886d5f92e838e2d4e6/core/util/compare/index.js#L51
We couldn't dig further into how to actually fix it. It might require some restructuring of how commands are executed, we're not sure.
edit: I think I forgot to explain. What we found out was, since backstop forks its process to run image comparisons, even if something in the forked process blows up and it dies, life just goes on for the main process, it exits and gives us a 0 exit status.
Contributor guide
Assessment
This issue has not been assessed yet.