Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add debugging for test-https-foafssl.js #34603

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions test/parallel/test-https-foafssl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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');
Expand Down