Skip to content

Commit

Permalink
chore: test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
abhilash-sivan committed Dec 19, 2024
1 parent 166e9d3 commit cde7f0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/collector/test/tracing/misc/restore_context/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const instana = require('../../../..')();
const bodyParser = require('body-parser');
const express = require('express');
const morgan = require('morgan');
const pino = require('pino')();
const bunyan = require('bunyan').createLogger({ name: 'test-app' });

const app = express();
const logPrefix = `Restore Context (${process.pid}):\t`;
Expand All @@ -39,7 +39,7 @@ app.post('/run', (req, res) => {
const activeContext = instana.sdk.getAsyncContext();
customCallbackQueue.push(() => {
instana.sdk.runInAsyncContext(activeContext, () => {
pino.warn('Should be traced.');
bunyan.warn('Should be traced.');
return res.send('Done! ✅');
});
});
Expand All @@ -58,7 +58,7 @@ app.post('/enter-and-leave', (req, res) => {
if (instana.core.tracing.getCls()) {
instana.core.tracing.getCls().enterAsyncContext(activeContext);
}
pino.warn('Should be traced.');
bunyan.warn('Should be traced.');
res.send('Done! ✅');
if (instana.core.tracing.getCls()) {
instana.core.tracing.getCls().leaveAsyncContext(activeContext);
Expand All @@ -68,7 +68,7 @@ app.post('/enter-and-leave', (req, res) => {

function createPromise(res) {
return new Promise(resolve => {
pino.warn('Should be traced.');
bunyan.warn('Should be traced.');
res.send('Done! ✅');
resolve();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ mochaSuiteFn('tracing/restore context', function () {
]);

expectAtLeastOneMatching(spans, [
span => expect(span.n).to.equal('log.pino'),
span => expect(span.n).to.equal('log.bunyan'),
span => expect(span.k).to.equal(constants.EXIT),
span => expect(span.p).to.equal(httpEntry.s),
span => expect(span.data.log.message).to.equal('Should be traced.')
Expand Down

0 comments on commit cde7f0a

Please sign in to comment.