@@ -70,8 +70,6 @@ server2.listen(0, listening());
70
70
server3 . listen ( 0 , listening ( ) ) ;
71
71
72
72
const responseErrors = { } ;
73
- let expectResponseCount = 0 ;
74
- let responseCount = 0 ;
75
73
let pending = 0 ;
76
74
77
75
@@ -126,17 +124,14 @@ function makeReq(path, port, error, host, ca) {
126
124
options . headers = { host : host } ;
127
125
}
128
126
const req = https . get ( options ) ;
129
- expectResponseCount ++ ;
130
127
const server = port === server1 . address ( ) . port ? server1 :
131
128
port === server2 . address ( ) . port ? server2 :
132
129
port === server3 . address ( ) . port ? server3 :
133
130
null ;
134
-
135
131
if ( ! server ) throw new Error ( 'invalid port: ' + port ) ;
136
132
server . expectCount ++ ;
137
133
138
- req . on ( 'response' , ( res ) => {
139
- responseCount ++ ;
134
+ req . on ( 'response' , common . mustCall ( ( res ) => {
140
135
assert . strictEqual ( res . connection . authorizationError , error ) ;
141
136
responseErrors [ path ] = res . connection . authorizationError ;
142
137
pending -- ;
@@ -146,7 +141,7 @@ function makeReq(path, port, error, host, ca) {
146
141
server3 . close ( ) ;
147
142
}
148
143
res . resume ( ) ;
149
- } ) ;
144
+ } ) ) ;
150
145
}
151
146
152
147
function allListening ( ) {
@@ -199,5 +194,4 @@ process.on('exit', () => {
199
194
assert . strictEqual ( server1 . requests . length , server1 . expectCount ) ;
200
195
assert . strictEqual ( server2 . requests . length , server2 . expectCount ) ;
201
196
assert . strictEqual ( server3 . requests . length , server3 . expectCount ) ;
202
- assert . strictEqual ( responseCount , expectResponseCount ) ;
203
197
} ) ;
0 commit comments