55// net.createConnection().
66
77const common = require ( '../common' ) ;
8+ console . log ( 'require completed: common' , Date . now ( ) ) ;
89const assert = require ( 'assert' ) ;
10+ console . log ( 'require completed: assert' , Date . now ( ) ) ;
911const net = require ( 'net' ) ;
12+ console . log ( 'require completed: net' , Date . now ( ) ) ;
1013const http = require ( 'http' ) ;
14+ console . log ( 'require completed: http' , Date . now ( ) ) ;
1115const { internalBinding } = require ( 'internal/test/binding' ) ;
16+ console . log ( 'require completed: internal/test/binding' , Date . now ( ) ) ;
1217const { UV_ENETUNREACH , UV_EADDRINUSE } = internalBinding ( 'uv' ) ;
1318const {
1419 newAsyncId,
1520 symbols : { async_id_symbol }
1621} = require ( 'internal/async_hooks' ) ;
22+ console . log ( 'require completed: internal/async_hooks' , Date . now ( ) ) ;
1723
1824const config = {
1925 host : 'http://example.com' ,
@@ -57,23 +63,28 @@ const handleWithBind = {
5763const agentWithoutBind = agentFactory ( handleWithoutBind , 3 ) ;
5864const agentWithBind = agentFactory ( handleWithBind , 2 ) ;
5965
66+ console . log ( 'test initiated: test-1' , Date . now ( ) ) ;
6067http . get ( {
6168 host : '127.0.0.1' ,
6269 port : 1 ,
6370 agent : agentWithoutBind ,
6471} ) . on ( 'error' , common . mustCall ( ( err ) => {
6572 assert . strictEqual ( err . code , 'ENETUNREACH' ) ;
73+ console . log ( 'test completed: test-1' , Date . now ( ) ) ;
6674} ) ) ;
6775
76+ console . log ( 'test initiated: test-2' , Date . now ( ) ) ;
6877http . request ( config . host , {
6978 agent : agentWithoutBind ,
7079 lookup ( _0 , _1 , cb ) {
7180 cb ( null , config . connectMultiple ) ;
7281 } ,
7382} ) . on ( 'error' , common . mustCall ( ( err ) => {
7483 assert . strictEqual ( err . code , 'ENETUNREACH' ) ;
84+ console . log ( 'test completed: test-2' , Date . now ( ) ) ;
7585} ) ) ;
7686
87+ console . log ( 'test initiated: test-3' , Date . now ( ) ) ;
7788http . request ( config . host , {
7889 agent : agentWithoutBind ,
7990 lookup ( _0 , _1 , cb ) {
@@ -82,16 +93,20 @@ http.request(config.host, {
8293 family : 4 ,
8394} ) . on ( 'error' , common . mustCall ( ( err ) => {
8495 assert . strictEqual ( err . code , 'ENETUNREACH' ) ;
96+ console . log ( 'test completed: test-3' , Date . now ( ) ) ;
8597} ) ) ;
8698
99+ console . log ( 'test initiated: test-4' , Date . now ( ) ) ;
87100http . request ( config . host , {
88101 agent : agentWithBind ,
89102 family : 4 , // We specify 'family' so 'internalConnect' is invoked
90103 localPort : 2222 // Required to trigger _handle.bind()
91104} ) . on ( 'error' , common . mustCall ( ( err ) => {
92105 assert . strictEqual ( err . code , 'EADDRINUSE' ) ;
106+ console . log ( 'test completed: test-4' , Date . now ( ) ) ;
93107} ) ) ;
94108
109+ console . log ( 'test initiated: test-5' , Date . now ( ) ) ;
95110http . request ( config . host , {
96111 agent : agentWithBind ,
97112 lookup ( _0 , _1 , cb ) {
@@ -100,4 +115,5 @@ http.request(config.host, {
100115 localPort : 2222 , // Required to trigger _handle.bind()
101116} ) . on ( 'error' , common . mustCall ( ( err ) => {
102117 assert . strictEqual ( err . code , 'EADDRINUSE' ) ;
118+ console . log ( 'test completed: test-5' , Date . now ( ) ) ;
103119} ) ) ;
0 commit comments