Skip to content

Commit 89ad54a

Browse files
authored
test: improve test output (#1333)
This test sometimes never completes when running on Jenkins. This commit adds en extra assertion that might help us identify why.
1 parent 210abb5 commit 89ad54a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/instrumentation/modules/http/_assert.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
module.exports = assert
44

55
function assert (t, data) {
6-
t.equal(data.transactions.length, 1)
7-
t.equal(data.spans.length, 0)
6+
t.equal(data.transactions.length, 1, 'should have one transaction')
7+
t.equal(data.spans.length, 0, 'should have zero spans')
88

99
var trans = data.transactions[0]
1010

11-
t.equal(trans.name, 'GET unknown route')
12-
t.equal(trans.type, 'request')
13-
t.equal(trans.result, 'HTTP 2xx')
14-
t.equal(trans.context.request.method, 'GET')
11+
t.equal(trans.name, 'GET unknown route', 'should have expected transaction name')
12+
t.equal(trans.type, 'request', 'should have expected transaction type')
13+
t.equal(trans.result, 'HTTP 2xx', 'should have expected transaction result')
14+
t.equal(trans.context.request.method, 'GET', 'should have expected transaction context.request.method')
1515
}

test/instrumentation/modules/http/aborted-requests-enabled.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ agent._conf.errorOnAbortedRequests = true
1414

1515
test('client-side abort below error threshold - call end', function (t) {
1616
var clientReq
17-
t.plan(8)
17+
t.plan(9)
1818

1919
resetAgent(function (data) {
2020
assert(t, data)
@@ -49,7 +49,7 @@ test('client-side abort below error threshold - call end', function (t) {
4949
t.fail('should not call http.get callback')
5050
})
5151
clientReq.on('error', function (err) {
52-
if (err.code !== 'ECONNRESET') throw err
52+
t.equal(err.code, 'ECONNRESET', 'client request should emit ECONNRESET error')
5353
})
5454
})
5555
})

0 commit comments

Comments
 (0)