Skip to content

Commit 9fdfbd1

Browse files
committed
chore: remove the test of already deleted process
1 parent 900eb99 commit 9fdfbd1

1 file changed

Lines changed: 2 additions & 45 deletions

File tree

test/test.js

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
/* global describe, it */
1212
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
13-
// make sure config has a infra token before spm-agent is laoded first time
13+
// make sure config has an infra token before spm-agent is laoded first time
1414
if (!process.env.INFRA_TOKEN) {
1515
process.env.INFRA_TOKEN = 'INFRA_TOKEN'
1616
}
@@ -52,7 +52,7 @@ describe('SPM for Node.js tests', function () {
5252
}).listen(port, '127.0.0.1')
5353
httpTest(njsAgent, done)
5454
setTimeout(function () {
55-
var request = require('request')
55+
const request = require('request')
5656
request.get('http://127.0.0.1:' + (port) + '/', function (err) {
5757
if (err) {
5858
console.log('Error' + err.stack)
@@ -149,47 +149,4 @@ describe('SPM for Node.js tests', function () {
149149
}
150150
NjsAgent.on('metric', checkMetrics)
151151
})
152-
153-
it('Wait for metrics: Process Agent', function (done) {
154-
this.timeout(30000)
155-
config.maxDataPoints = 1
156-
config.logger.console = false
157-
config.logger.level = 'debug'
158-
let metricCounter = 0
159-
let errorReported = false
160-
const ProcessAgent = require('../lib/processAgent.js')
161-
const agent = new ProcessAgent()
162-
agent.start()
163-
164-
function checkMetrics (metric) {
165-
if (errorReported) {
166-
return
167-
}
168-
if (metric.measurement && metric.measurement.indexOf('process') > -1 &&
169-
metric.fields.uptime &&
170-
metric.fields.rss &&
171-
metric.fields['cpu.usage'] &&
172-
metric.fields['thread.count']) {
173-
if (metric.tags.token !== config.tokens.infra) {
174-
done(new Error(`No infra token set ${metric.tags.token} != ${config.tokens.infra}`))
175-
errorReported = true
176-
}
177-
metricCounter = metricCounter + 1
178-
}
179-
if (metric.measurement && metric.measurement.indexOf('process') > -1 && metric.fields.count) {
180-
if (metric.tags.token !== config.tokens.infra) {
181-
done(new Error(`No infra token set ${metric.tags.token} != ${config.tokens.infra}`))
182-
errorReported = true
183-
}
184-
metricCounter = metricCounter + 1
185-
}
186-
187-
if (metricCounter > 2) {
188-
agent.removeListener('metric', checkMetrics)
189-
agent.stop()
190-
done()
191-
}
192-
}
193-
agent.on('metric', checkMetrics)
194-
})
195152
})

0 commit comments

Comments
 (0)