diff --git a/gulpfile.js b/gulpfile.js index 623f6db37..397bea14c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -122,6 +122,16 @@ function safeSpawnSync(command, parameters, options) { return result; } +function startNode(args, options) { + // Node.js decreased the maximum header size from 80 KB to 8 KB in newer + // releases, which is not sufficient for some of our reference test files + // (such as `issue6360.pdf`), so we need to restore this value. Note that + // this argument needs to be before all other arguments as it needs to be + // passed to the Node.js process itself and not to the script that it runs. + args.unshift('--max-http-header-size=80000'); + return spawn('node', args, options); +} + function createStringSource(filename, content) { var source = stream.Readable({ objectMode: true, }); source._read = function () { @@ -405,7 +415,7 @@ function createTestSource(testsName, bot) { args.push('--strictVerify'); } - var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', }); + var testProcess = startNode(args, { cwd: TEST_DIR, stdio: 'inherit', }); testProcess.on('close', function (code) { source.push(null); }); @@ -435,7 +445,7 @@ function makeRef(done, bot) { args.push('--noPrompts', '--strictVerify'); } args.push('--browserManifestFile=' + PDF_BROWSERS); - var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', }); + var testProcess = startNode(args, { cwd: TEST_DIR, stdio: 'inherit', }); testProcess.on('close', function (code) { done(); }); @@ -1146,7 +1156,7 @@ gulp.task('baseline', function (done) { gulp.task('unittestcli', gulp.series('testing-pre', 'lib', function(done) { var options = ['node_modules/jasmine/bin/jasmine', 'JASMINE_CONFIG_PATH=test/unit/clitests.json']; - var jasmineProcess = spawn('node', options, { stdio: 'inherit', }); + var jasmineProcess = startNode(options, { stdio: 'inherit', }); jasmineProcess.on('close', function(code) { if (code !== 0) { done(new Error('Unit tests failed.')); @@ -1163,7 +1173,7 @@ gulp.task('lint', gulp.series('default_preferences', function(done) { // Ensure that we lint the Firefox specific *.jsm files too. var options = ['node_modules/eslint/bin/eslint', '--ext', '.js,.jsm', '.', '--report-unused-disable-directives']; - var esLintProcess = spawn('node', options, { stdio: 'inherit', }); + var esLintProcess = startNode(options, { stdio: 'inherit', }); esLintProcess.on('close', function (code) { if (code !== 0) { done(new Error('ESLint failed.'));