File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ function makeHttp10Request(cb) {
5050 '\r\n' ) ;
5151 socket . resume ( ) ; // Ignore the response itself
5252
53- setTimeout ( function ( ) {
54- cb ( socket ) ;
55- } , common . platformTimeout ( 50 ) ) ;
53+ // Invoke the callback when the socket closes. The server should close it
54+ // immediately after sending the response.
55+ socket . on ( 'close' , cb ) ;
56+ // If the socket is not closed, the test will fail with a timeout.
5657 } ) ;
5758}
5859
@@ -63,8 +64,6 @@ server.listen(0, function() {
6364 assert . strictEqual ( firstSocket , secondSocket ) ;
6465
6566 makeHttp10Request ( function ( socket ) {
66- // The server should have immediately closed the HTTP/1.0 socket:
67- assert . strictEqual ( socket . closed , true ) ;
6867 server . close ( ) ;
6968 } ) ;
7069 } ) ;
You can’t perform that action at this time.
0 commit comments