You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: destroy active connections when stopping fake agent (#5853)
The fake agent is used in tests and is stopped after the test is done.
When calling its `stop` function, it will wait for active connections (sockets)
to close before considering itself stopped. This can add an unnecessary waiting
period after each test, as the timeout on the socket by default is two seconds
in our code-base:
https://github.com/DataDog/dd-trace-js/blob/90fe64b9845d04d6273ec2b7a36ba6a7844b8253/packages/dd-trace/src/exporters/common/request.js#L56
For integration tests making heavy use of fake agents, this can add several
minutes of overhead that can be avoided by destroying the sockets when calling
the `stop` function on the fake agent.
This mainly affects tests running on Node.js 18, as sockets there for some
reason takes a little longer to clear out.
0 commit comments