Skip to content

Commit

Permalink
fix(diff): small default maxBuffer
Browse files Browse the repository at this point in the history
By default, Node's spawnSync has a maxBuffer of 1 MB. This bumps it up
to 10 MB, which should reduce the chance of diffs on large images
failing.
  • Loading branch information
Gaelan committed Feb 1, 2020
1 parent 27fcd0b commit df713f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/diff-snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ function runDiffImageToSnapshot(options) {

const writeDiffProcess = childProcess.spawnSync(
process.execPath, [`${__dirname}/diff-process.js`],
{ input: Buffer.from(serializedInput), stdio: ['pipe', 'inherit', 'inherit', 'pipe'] }
{
input: Buffer.from(serializedInput),
stdio: ['pipe', 'inherit', 'inherit', 'pipe'],
maxBuffer: 10 * 1024 * 1024, // 10 MB
}
);

if (writeDiffProcess.status === 0) {
Expand Down

0 comments on commit df713f6

Please sign in to comment.