diff --git a/packages/datadog-plugin-net/test/index.spec.js b/packages/datadog-plugin-net/test/index.spec.js index adcf175e405..3d4e3b72d76 100644 --- a/packages/datadog-plugin-net/test/index.spec.js +++ b/packages/datadog-plugin-net/test/index.spec.js @@ -228,14 +228,8 @@ describe('Plugin', () => { socket.destroy() socket.once('close', () => { - setImmediate(() => { - // Node.js 21.2 broke this function. We'll have to do the more manual way for now. - // expect(socket.eventNames()).to.not.include.members(events) - for (const event of events) { - expect(socket.listeners(event)).to.have.lengthOf(0) - } - done() - }) + expect(socket.eventNames()).to.not.include.members(events) + done() }) }) })