diff --git a/test/async-hooks/test-http-agent-handle-reuse-parallel.js b/test/async-hooks/test-http-agent-handle-reuse-parallel.js index a7d76a694b24d3..2fbde1b5cdb489 100644 --- a/test/async-hooks/test-http-agent-handle-reuse-parallel.js +++ b/test/async-hooks/test-http-agent-handle-reuse-parallel.js @@ -4,7 +4,10 @@ const common = require('../common'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); const assert = require('assert'); -const { async_id_symbol } = require('internal/async_hooks').symbols; +const { + async_id_symbol, + owner_symbol, +} = require('internal/async_hooks').symbols; const http = require('http'); // Checks that the async resource used in init in case of a reused handle @@ -86,5 +89,8 @@ function onExit() { // Verify reuse handle has been wrapped assert.strictEqual(first.type, second.type); - assert.ok(first.handle !== second.handle, 'Resource reused'); + assert.ok(first.handle[owner_symbol].handle !== second.handle, + 'Resource reused'); + assert.ok(first.handle[owner_symbol].handle === second.handle.handle, + 'Resource not wrapped correctly'); } diff --git a/test/async-hooks/test-http-agent-handle-reuse-serial.js b/test/async-hooks/test-http-agent-handle-reuse-serial.js index 2ee118bb240a36..8cae2e04e76d72 100644 --- a/test/async-hooks/test-http-agent-handle-reuse-serial.js +++ b/test/async-hooks/test-http-agent-handle-reuse-serial.js @@ -4,7 +4,10 @@ const common = require('../common'); const initHooks = require('./init-hooks'); const { checkInvocations } = require('./hook-checks'); const assert = require('assert'); -const { async_id_symbol } = require('internal/async_hooks').symbols; +const { + async_id_symbol, + owner_symbol, +} = require('internal/async_hooks').symbols; const http = require('http'); // Checks that the async resource used in init in case of a reused handle @@ -104,5 +107,8 @@ function onExit() { // Verify reuse handle has been wrapped assert.strictEqual(first.type, second.type); - assert.ok(first.handle !== second.handle, 'Resource reused'); + assert.ok(first.handle[owner_symbol].handle !== second.handle, + 'Resource reused'); + assert.ok(first.handle[owner_symbol].handle === second.handle.handle, + 'Resource not wrapped correctly'); }