Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 86a3bd0

Browse filesBrowse files
santigimenoindutny
authored andcommitted
test: fix tls-inception
Make sure all the data is read before checking its validity. Remove `gotHello` variable and just check that the ssl `end` event is received. Remove unused variables. PR-URL: #4195 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Fedor Indutny <fedor@indutny.com>
1 parent 37ed05b commit 86a3bd0
Copy full SHA for 86a3bd0

File tree

Expand file treeCollapse file tree

1 file changed

+4
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-10
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-tls-inception.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-inception.js
+4-10Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ var fs = require('fs');
1212
var path = require('path');
1313
var net = require('net');
1414

15-
var options, a, b, portA, portB;
16-
var gotHello = false;
15+
var options, a, b;
1716

1817
var body = new Buffer(4000).fill('A');
1918

@@ -43,10 +42,6 @@ b = tls.createServer(options, function(socket) {
4342
socket.end(body);
4443
});
4544

46-
process.on('exit', function() {
47-
assert(gotHello);
48-
});
49-
5045
a.listen(common.PORT, function() {
5146
b.listen(common.PORT + 1, function() {
5247
options = {
@@ -62,15 +57,14 @@ a.listen(common.PORT, function() {
6257
});
6358
ssl.setEncoding('utf8');
6459
var buf = '';
65-
ssl.once('data', function(data) {
60+
ssl.on('data', function(data) {
6661
buf += data;
67-
gotHello = true;
6862
});
69-
ssl.on('end', function() {
63+
ssl.on('end', common.mustCall(function() {
7064
assert.equal(buf, body);
7165
ssl.end();
7266
a.close();
7367
b.close();
74-
});
68+
}));
7569
});
7670
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.