@@ -91,8 +91,6 @@ server2.listen(0, listening());
91
91
server3 . listen ( 0 , listening ( ) ) ;
92
92
93
93
const responseErrors = { } ;
94
- let expectResponseCount = 0 ;
95
- let responseCount = 0 ;
96
94
let pending = 0 ;
97
95
98
96
@@ -147,17 +145,14 @@ function makeReq(path, port, error, host, ca) {
147
145
options . headers = { host : host } ;
148
146
}
149
147
const req = https . get ( options ) ;
150
- expectResponseCount ++ ;
151
148
const server = port === server1 . address ( ) . port ? server1 :
152
149
port === server2 . address ( ) . port ? server2 :
153
150
port === server3 . address ( ) . port ? server3 :
154
151
null ;
155
-
156
152
if ( ! server ) throw new Error ( 'invalid port: ' + port ) ;
157
153
server . expectCount ++ ;
158
154
159
- req . on ( 'response' , ( res ) => {
160
- responseCount ++ ;
155
+ req . on ( 'response' , common . mustCall ( ( res ) => {
161
156
assert . strictEqual ( res . connection . authorizationError , error ) ;
162
157
responseErrors [ path ] = res . connection . authorizationError ;
163
158
pending -- ;
@@ -167,7 +162,7 @@ function makeReq(path, port, error, host, ca) {
167
162
server3 . close ( ) ;
168
163
}
169
164
res . resume ( ) ;
170
- } ) ;
165
+ } ) ) ;
171
166
}
172
167
173
168
function allListening ( ) {
@@ -220,5 +215,4 @@ process.on('exit', () => {
220
215
assert . strictEqual ( server1 . requests . length , server1 . expectCount ) ;
221
216
assert . strictEqual ( server2 . requests . length , server2 . expectCount ) ;
222
217
assert . strictEqual ( server3 . requests . length , server3 . expectCount ) ;
223
- assert . strictEqual ( responseCount , expectResponseCount ) ;
224
218
} ) ;
0 commit comments