diff --git a/packages/datadog-plugin-net/test/index.spec.js b/packages/datadog-plugin-net/test/index.spec.js index 09532ad0502..0f47b0c9034 100644 --- a/packages/datadog-plugin-net/test/index.spec.js +++ b/packages/datadog-plugin-net/test/index.spec.js @@ -230,8 +230,14 @@ describe('Plugin', () => { socket.destroy() socket.once('close', () => { - expect(socket.eventNames()).to.not.include.members(events) - done() + 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() + }) }) }) })