@@ -122,6 +122,16 @@ function safeSpawnSync(command, parameters, options) {
122
122
return result ;
123
123
}
124
124
125
+ function startNode ( args , options ) {
126
+ // Node.js decreased the maximum header size from 80 KB to 8 KB in newer
127
+ // releases, which is not sufficient for some of our reference test files
128
+ // (such as `issue6360.pdf`), so we need to restore this value. Note that
129
+ // this argument needs to be before all other arguments as it needs to be
130
+ // passed to the Node.js process itself and not to the script that it runs.
131
+ args . unshift ( '--max-http-header-size=80000' ) ;
132
+ return spawn ( 'node' , args , options ) ;
133
+ }
134
+
125
135
function createStringSource ( filename , content ) {
126
136
var source = stream . Readable ( { objectMode : true , } ) ;
127
137
source . _read = function ( ) {
@@ -405,7 +415,7 @@ function createTestSource(testsName, bot) {
405
415
args . push ( '--strictVerify' ) ;
406
416
}
407
417
408
- var testProcess = spawn ( 'node' , args , { cwd : TEST_DIR , stdio : 'inherit' , } ) ;
418
+ var testProcess = startNode ( args , { cwd : TEST_DIR , stdio : 'inherit' , } ) ;
409
419
testProcess . on ( 'close' , function ( code ) {
410
420
source . push ( null ) ;
411
421
} ) ;
@@ -435,7 +445,7 @@ function makeRef(done, bot) {
435
445
args . push ( '--noPrompts' , '--strictVerify' ) ;
436
446
}
437
447
args . push ( '--browserManifestFile=' + PDF_BROWSERS ) ;
438
- var testProcess = spawn ( 'node' , args , { cwd : TEST_DIR , stdio : 'inherit' , } ) ;
448
+ var testProcess = startNode ( args , { cwd : TEST_DIR , stdio : 'inherit' , } ) ;
439
449
testProcess . on ( 'close' , function ( code ) {
440
450
done ( ) ;
441
451
} ) ;
@@ -1146,7 +1156,7 @@ gulp.task('baseline', function (done) {
1146
1156
gulp . task ( 'unittestcli' , gulp . series ( 'testing-pre' , 'lib' , function ( done ) {
1147
1157
var options = [ 'node_modules/jasmine/bin/jasmine' ,
1148
1158
'JASMINE_CONFIG_PATH=test/unit/clitests.json' ] ;
1149
- var jasmineProcess = spawn ( 'node' , options , { stdio : 'inherit' , } ) ;
1159
+ var jasmineProcess = startNode ( options , { stdio : 'inherit' , } ) ;
1150
1160
jasmineProcess . on ( 'close' , function ( code ) {
1151
1161
if ( code !== 0 ) {
1152
1162
done ( new Error ( 'Unit tests failed.' ) ) ;
@@ -1163,7 +1173,7 @@ gulp.task('lint', gulp.series('default_preferences', function(done) {
1163
1173
// Ensure that we lint the Firefox specific *.jsm files too.
1164
1174
var options = [ 'node_modules/eslint/bin/eslint' , '--ext' , '.js,.jsm' , '.' ,
1165
1175
'--report-unused-disable-directives' ] ;
1166
- var esLintProcess = spawn ( 'node' , options , { stdio : 'inherit' , } ) ;
1176
+ var esLintProcess = startNode ( options , { stdio : 'inherit' , } ) ;
1167
1177
esLintProcess . on ( 'close' , function ( code ) {
1168
1178
if ( code !== 0 ) {
1169
1179
done ( new Error ( 'ESLint failed.' ) ) ;
0 commit comments