-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ensure correct run context for 'mongodb' instrumentation #2512
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
run module tests for mongodb |
-- running test "node test/instrumentation/modules/mongodb.test.js" with mongodb /app/node_modules/mongodb/lib/utils.js:698 throw error; ^ TypeError: Cannot read property 'db' of undefined at server.connect (/app/test/instrumentation/modules/mongodb.test.js:49:24) at /app/node_modules/mongodb/lib/utils.js:695:9 at err (/app/node_modules/mongodb/lib/mongo_client.js:285:23) at connectCallback (/app/node_modules/mongodb/lib/operations/connect.js:367:5) at topology.connect.err (/app/node_modules/mongodb/lib/operations/connect.js:554:14) ...
run module tests for mongodb |
run module tests for mongodb |
- ensure a mongodb span is not accidentally a child of an inflight mongodb span - Fix an issue where instrumentation of `new MongoClient(url)` would fail because the internal handling of `arguments` would add `arguments[1]` but arguments.length stayed at 1. Fix by first changing to an Array. - Fix instrument of a connection made using the MongoClient.connect static method. #2467
run module tests for mongodb |
Getting test failures in Jenkins CI with TAV tests. At least one of the errors is with |
The issue was that `tape` will automatically `t.end()` an *async* test case tape.test('my test case', async function () { ... }) when the returned Promise resolves. This can happen before the `resetAgent` callback has been called.
run module tests for mongodb |
run module tests for mongodb |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
Also:
new MongoClient(url)
wouldfail because the internal handling of
arguments
would addarguments[1]
but arguments.length stayed at 1. Fix by firstchanging to an Array.
static method. MongoDB instrumentation not working with MongoClient.connect static method #2467
Refs: #2430
Fixes: #2467
Checklist
.end() already called
error in Jenkins.