summaryrefslogtreecommitdiff
path: root/test/parallel/test-https-timeout-server.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-https-timeout-server.js')
-rw-r--r--test/parallel/test-https-timeout-server.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/test/parallel/test-https-timeout-server.js b/test/parallel/test-https-timeout-server.js
index e084ec556b..92b06f1495 100644
--- a/test/parallel/test-https-timeout-server.js
+++ b/test/parallel/test-https-timeout-server.js
@@ -11,12 +11,6 @@ var https = require('https');
var net = require('net');
var fs = require('fs');
-var clientErrors = 0;
-
-process.on('exit', function() {
- assert.equal(clientErrors, 1);
-});
-
var options = {
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'),
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'),
@@ -25,15 +19,14 @@ var options = {
var server = https.createServer(options, common.fail);
-server.on('clientError', function(err, conn) {
+server.on('clientError', common.mustCall(function(err, conn) {
// Don't hesitate to update the asserts if the internal structure of
// the cleartext object ever changes. We're checking that the https.Server
// has closed the client connection.
assert.equal(conn._secureEstablished, false);
server.close();
- clientErrors++;
conn.destroy();
-});
+}));
server.listen(0, function() {
net.connect({ host: '127.0.0.1', port: this.address().port });