diff --git a/lib/start.js b/lib/start.js index 7f33911253..ae4ff6fcd1 100644 --- a/lib/start.js +++ b/lib/start.js @@ -104,9 +104,9 @@ const start = (passthroughArgs, buildConfig = config.defaultBuildConfig, options let cmdOptions = { stdio: 'inherit', timeout: options.network_log ? 120000 : undefined, - continueOnFail: options.network_log ? true : false, - shell: process.platform === 'darwin' ? true : false, - killSignal: options.network_log && process.env.RELEASE_TYPE ? 'SIGKILL' : 'SIGTERM' + continueOnFail: !!options.network_log, + shell: process.platform === 'darwin' || !!options.network_log, + killSignal: 'SIGTERM' } if (options.network_log) { @@ -133,15 +133,9 @@ const start = (passthroughArgs, buildConfig = config.defaultBuildConfig, options if (options.network_log) { let exitCode = 0 - let jsonOutput = {} // Read the network log - let jsonContent = fs.readFileSync(networkLogFile, 'utf8').trim() - // On windows netlog ends abruptly causing JSON parsing errors - if (!jsonContent.endsWith('}]}')) { - const n = jsonContent.lastIndexOf('},') - jsonContent = jsonContent.substring(0, n) + '}]}' - } - jsonOutput = JSON.parse(jsonContent) + const jsonContent = fs.readFileSync(networkLogFile, 'utf8').trim() + const jsonOutput = JSON.parse(jsonContent) const URL_REQUEST_TYPE = jsonOutput.constants.logSourceType.URL_REQUEST const URL_REQUEST_FAKE_RESPONSE_HEADERS_CREATED = jsonOutput.constants.logEventTypes.URL_REQUEST_FAKE_RESPONSE_HEADERS_CREATED