Skip to content

Commit 1a8c0b2

Browse files
committed
writer is called, its the telemetry that doesnt happen
1 parent 5aed458 commit 1a8c0b2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/dd-trace/test/exporters/agent/writer.spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,22 @@ function describeWriter (protocolVersion) {
147147
})
148148
})
149149

150+
it('should log request errors', done => {
151+
const error = new Error('boom')
152+
error.status = 42
153+
154+
request.yields(error)
155+
156+
encoder.count.returns(1)
157+
writer.flush()
158+
159+
setTimeout(() => {
160+
expect(log.error)
161+
.to.have.been.calledWith('Error sending payload to the agent (status code: %s)', error.status, error, log.MUTE)
162+
done()
163+
})
164+
})
165+
150166
it('should update sampling rates', (done) => {
151167
encoder.count.returns(1)
152168
writer.flush(() => {

0 commit comments

Comments
 (0)