File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ const common = require('../common');
44const initHooks = require ( './init-hooks' ) ;
55const { checkInvocations } = require ( './hook-checks' ) ;
66const assert = require ( 'assert' ) ;
7- const { async_id_symbol } = require ( 'internal/async_hooks' ) . symbols ;
7+ const {
8+ async_id_symbol,
9+ owner_symbol,
10+ } = require ( 'internal/async_hooks' ) . symbols ;
811const http = require ( 'http' ) ;
912
1013// Checks that the async resource used in init in case of a reused handle
@@ -86,5 +89,8 @@ function onExit() {
8689
8790 // Verify reuse handle has been wrapped
8891 assert . strictEqual ( first . type , second . type ) ;
89- assert . ok ( first . handle !== second . handle , 'Resource reused' ) ;
92+ assert . ok ( first . handle [ owner_symbol ] . handle !== second . handle ,
93+ 'Resource reused' ) ;
94+ assert . ok ( first . handle [ owner_symbol ] . handle === second . handle . handle ,
95+ 'Resource not wrapped correctly' ) ;
9096}
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ const common = require('../common');
44const initHooks = require ( './init-hooks' ) ;
55const { checkInvocations } = require ( './hook-checks' ) ;
66const assert = require ( 'assert' ) ;
7- const { async_id_symbol } = require ( 'internal/async_hooks' ) . symbols ;
7+ const {
8+ async_id_symbol,
9+ owner_symbol,
10+ } = require ( 'internal/async_hooks' ) . symbols ;
811const http = require ( 'http' ) ;
912
1013// Checks that the async resource used in init in case of a reused handle
@@ -104,5 +107,8 @@ function onExit() {
104107
105108 // Verify reuse handle has been wrapped
106109 assert . strictEqual ( first . type , second . type ) ;
107- assert . ok ( first . handle !== second . handle , 'Resource reused' ) ;
110+ assert . ok ( first . handle [ owner_symbol ] . handle !== second . handle ,
111+ 'Resource reused' ) ;
112+ assert . ok ( first . handle [ owner_symbol ] . handle === second . handle . handle ,
113+ 'Resource not wrapped correctly' ) ;
108114}
You can’t perform that action at this time.
0 commit comments