From 54a55bfa2af8fbdedb910ed4414c0a31f6795113 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 7 Jun 2019 14:20:43 +0200 Subject: [PATCH] http: fix test where aborted should not be emitted --- lib/_http_common.js | 6 +----- test/parallel/test-http-response-no-headers.js | 1 + test/parallel/test-http-response-status-message.js | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/_http_common.js b/lib/_http_common.js index 75995260128862..987bfe86612e7f 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -24,11 +24,7 @@ const { Math } = primordials; const { setImmediate } = require('timers'); -const { getOptionValue } = require('internal/options'); - -const { methods, HTTPParser } = - getOptionValue('--http-parser') === 'legacy' ? - internalBinding('http_parser') : internalBinding('http_parser_llhttp'); +const { methods, HTTPParser } = internalBinding('http_parser'); const FreeList = require('internal/freelist'); const { ondrain } = require('internal/http'); diff --git a/test/parallel/test-http-response-no-headers.js b/test/parallel/test-http-response-no-headers.js index 87b0f8e67faf7c..22705936e08254 100644 --- a/test/parallel/test-http-response-no-headers.js +++ b/test/parallel/test-http-response-no-headers.js @@ -51,6 +51,7 @@ function test(httpVersion, callback) { body += data; }); + res.on('aborted', common.mustNotCall()); res.on('end', common.mustCall(function() { assert.strictEqual(body, expected[httpVersion]); server.close(); diff --git a/test/parallel/test-http-response-status-message.js b/test/parallel/test-http-response-status-message.js index 0f9bce8fa87d67..c4256d9e5a0c49 100644 --- a/test/parallel/test-http-response-status-message.js +++ b/test/parallel/test-http-response-status-message.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const http = require('http'); const net = require('net'); @@ -71,6 +71,7 @@ function runTest(testCaseIndex) { console.log(`client: actual status message: ${response.statusMessage}`); assert.strictEqual(testCase.statusMessage, response.statusMessage); + response.on('aborted', common.mustNotCall()); response.on('end', function() { countdown.dec(); if (testCaseIndex + 1 < testCases.length) {