Skip to content

Commit

Permalink
test(ioredis): remove console.log (open-telemetry#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaniv Davidi committed Aug 25, 2021
1 parent b213984 commit c25bc38
Showing 1 changed file with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,7 @@ describe('ioredis', () => {
context.with(trace.setSpan(context.active(), span), () => {
const stream = client.scanStream();
stream
.on('data', resultKeys => {
// `resultKeys` is an array of strings representing key names.
// Note that resultKeys may contain 0 keys, and that it will sometimes
// contain duplicates due to SCAN's implementation in Redis.
for (let i = 0; i < resultKeys.length; i++) {
console.log(resultKeys[i]);
}
})
.on('end', () => {
console.log('all keys have been visited');
assert.strictEqual(memoryExporter.getFinishedSpans().length, 1);
span.end();
const endedSpans = memoryExporter.getFinishedSpans();
Expand All @@ -364,6 +355,9 @@ describe('ioredis', () => {
.on('error', err => {
done(err);
});

// Put stream into flowing mode so it will invoke 'end' listener
stream.resume();
});
});

Expand Down Expand Up @@ -858,17 +852,13 @@ describe('ioredis', () => {
_cmdArgs: Array<string | Buffer | number>,
response: unknown
) => {
try {
assert.strictEqual(cmdName, 'incr');
// the command is 'incr' on a key which does not exist, thus it increase 0 by 1 and respond 1
assert.strictEqual(response, 1);
span.setAttribute(
'attribute key from hook',
'custom value from hook'
);
} catch (err) {
console.log(err);
}
assert.strictEqual(cmdName, 'incr');
// the command is 'incr' on a key which does not exist, thus it increase 0 by 1 and respond 1
assert.strictEqual(response, 1);
span.setAttribute(
'attribute key from hook',
'custom value from hook'
);
},
};
instrumentation = new IORedisInstrumentation(config);
Expand Down

0 comments on commit c25bc38

Please sign in to comment.