diff --git a/test/parallel/test-https-foafssl.js b/test/parallel/test-https-foafssl.js index 43057817043789..ff2c7d4387ee1b 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -56,7 +56,8 @@ const server = https.createServer(options, common.mustCall(function(req, res) { assert.strictEqual(cert.exponent, exponent); assert.strictEqual(cert.modulus, modulus); res.writeHead(200, { 'content-type': 'text/plain' }); - res.end(body); + res.end(body, () => { console.log('stream finished'); }); + console.log('sent response'); })); server.listen(0, function() { @@ -69,10 +70,15 @@ server.listen(0, function() { const client = spawn(common.opensslCli, args); client.stdout.on('data', function(data) { + console.log('response received'); const message = data.toString(); const contents = message.split(CRLF + CRLF).pop(); assert.strictEqual(body, contents); - server.close(); + server.close((e) => { + assert.ifError(e); + console.log('server closed'); + }); + console.log('server.close() called'); }); client.stdin.write('GET /\n\n');