-
Notifications
You must be signed in to change notification settings - Fork 424
Open
Labels
Description
Some time recently, an ioredis
test has started failing seemingly at random. The most current instance is https://github.com/newrelic/node-newrelic/actions/runs/17036192786/job/48289159715#step:7:190.
The failing test is:
node-newrelic/test/versioned/ioredis/ioredis.test.js
Lines 142 to 177 in aa3f8d9
await t.test('should not add instance attributes to redis segments when disabled', async (t) => { | |
const { agent, redisClient, HOST_ID } = t.nr | |
const plan = tspl(t, { plan: 13 }) | |
agent.config.datastore_tracer.instance_reporting.enabled = false | |
agent.config.datastore_tracer.database_name_reporting.enabled = false | |
agent.on('transactionFinished', function (tx) { | |
const root = tx.trace.root | |
const children = tx.trace.getChildren(root.id) | |
plan.equal(children.length, 2, 'root has two children') | |
const [setSegment, getSegment] = children | |
const setAttrs = setSegment.getAttributes() | |
const getAttrs = getSegment.getAttributes() | |
plan.equal(setAttrs.host, undefined) | |
plan.equal(setAttrs.product, 'Redis') | |
plan.equal(setAttrs.key, '"testkey"') | |
plan.equal(setAttrs.port_path_or_id, undefined) | |
plan.equal(setAttrs.database_name, undefined) | |
plan.equal(getAttrs.host, undefined) | |
plan.equal(getAttrs.product, 'Redis') | |
plan.equal(getAttrs.key, '"testkey"') | |
plan.equal(getAttrs.port_path_or_id, undefined) | |
plan.equal(getAttrs.database_name, undefined) | |
const unscoped = tx.metrics.unscoped | |
plan.equal(unscoped[`Datastore/instance/Redis/${HOST_ID}`], undefined) | |
}) | |
helper.runInTransaction(agent, async (transaction) => { | |
await redisClient.set('testkey', 'testvalue') | |
const value = await redisClient.get('testkey') | |
plan.equal(value, 'testvalue', 'should have expected value') | |
transaction.end() | |
}) | |
await plan.completed | |
}) |
In particular, the value returned from the Redis store seems to be inconsistent:
node-newrelic/test/versioned/ioredis/ioredis.test.js
Lines 172 to 173 in aa3f8d9
const value = await redisClient.get('testkey') | |
plan.equal(value, 'testvalue', 'should have expected value') |
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Reviewed