From c34326b286fed0680a481f6c1d9c1c0f0857f56e Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Tue, 12 Feb 2013 15:00:13 +0400 Subject: [PATCH] test: fix tests after ECONNRESET patch --- test/simple/test-tls-over-http-tunnel.js | 4 ++++ test/simple/test-tls-session-cache.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/test/simple/test-tls-over-http-tunnel.js b/test/simple/test-tls-over-http-tunnel.js index 0920a35d642..d4bccf5800c 100644 --- a/test/simple/test-tls-over-http-tunnel.js +++ b/test/simple/test-tls-over-http-tunnel.js @@ -34,6 +34,7 @@ var https = require('https'); var proxyPort = common.PORT + 1; var gotRequest = false; +var errorCount = 0; var key = fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'); var cert = fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'); @@ -162,10 +163,13 @@ proxy.listen(proxyPort, function() { proxy.close(); server.close(); }); + }).on('error', function() { + errorCount++; }).end(); } }); process.on('exit', function() { assert.ok(gotRequest); + assert.equal(errorCount, 1); }); diff --git a/test/simple/test-tls-session-cache.js b/test/simple/test-tls-session-cache.js index 325b2ec7fe2..2bfac0df910 100644 --- a/test/simple/test-tls-session-cache.js +++ b/test/simple/test-tls-session-cache.js @@ -50,9 +50,13 @@ function doTest() { requestCert: true }; var requestCount = 0; + var errorCount = 0; var session; var server = tls.createServer(options, function(cleartext) { + cleartext.on('error', function() { + errorCount++; + }); ++requestCount; cleartext.end(); }); @@ -94,5 +98,6 @@ function doTest() { // initial request + reconnect requests (5 times) assert.equal(requestCount, 6); + assert.equal(errorCount, 4); }); }