File tree 2 files changed +16
-4
lines changed 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');
4
4
const initHooks = require ( './init-hooks' ) ;
5
5
const { checkInvocations } = require ( './hook-checks' ) ;
6
6
const 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 ;
8
11
const http = require ( 'http' ) ;
9
12
10
13
// Checks that the async resource used in init in case of a reused handle
@@ -86,5 +89,8 @@ function onExit() {
86
89
87
90
// Verify reuse handle has been wrapped
88
91
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' ) ;
90
96
}
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ const common = require('../common');
4
4
const initHooks = require ( './init-hooks' ) ;
5
5
const { checkInvocations } = require ( './hook-checks' ) ;
6
6
const 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 ;
8
11
const http = require ( 'http' ) ;
9
12
10
13
// Checks that the async resource used in init in case of a reused handle
@@ -104,5 +107,8 @@ function onExit() {
104
107
105
108
// Verify reuse handle has been wrapped
106
109
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' ) ;
108
114
}
You can’t perform that action at this time.
0 commit comments