Skip to content

Commit

Permalink
test: reduce flakiness of test-http-remove-header-stays-removed.js
Browse files Browse the repository at this point in the history
Refs: nodejs/reliability#508
Refs: #46333
PR-URL: #46855
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
debadree25 authored and RafaelGSS committed Apr 7, 2023
1 parent 8f9b9c1 commit 49981b9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/parallel/test-http-remove-header-stays-removed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -56,6 +56,14 @@ server.listen(0, function() {
res.setEncoding('ascii');
res.on('data', function(chunk) {
response += chunk;
if (response === 'beep boop\n') {
setTimeout(function() {
// The socket should be closed immediately, with no keep-alive, because
// no content-length or transfer-encoding are used:
assert.strictEqual(res.socket.closed, true);
server.close();
}, common.platformTimeout(15));
}
});
});
});

0 comments on commit 49981b9

Please sign in to comment.