Skip to content
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

chore(NODE-6664): use correct script_name and replacement substring #4370

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions test/integration/node-specific/resource_clean_up.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,22 @@ describe('Driver Resources', () => {
if (globalThis.AbortController == null || typeof this.configuration.serverApi === 'string') {
return;
}
try {
const res = await runScriptAndReturnHeapInfo(
'no_resource_leak_connect_close',
this.configuration,
async function run({ MongoClient, uri }) {
const mongoClient = new MongoClient(uri, { minPoolSize: 100 });
await mongoClient.connect();
// Any operations will reproduce the issue found in v5.0.0/v4.13.0
// it would seem the MessageStream has to be used?
await mongoClient.db().command({ ping: 1 });
await mongoClient.close();
}
);
startingMemoryUsed = res.startingMemoryUsed;
endingMemoryUsed = res.endingMemoryUsed;
heap = res.heap;
} catch (error) {
// We don't expect the process execution to ever fail,
// leaving helpful debugging if we see this in CI
console.log(`runScript error message: ${error.message}`);
console.log(`runScript error stack: ${error.stack}`);
console.log(`runScript error cause: ${error.cause}`);
// Fail the test
this.test?.error(error);
}
const res = await runScriptAndReturnHeapInfo(
'no_resource_leak_connect_close',
this.configuration,
async function run({ MongoClient, uri }) {
const mongoClient = new MongoClient(uri, { minPoolSize: 100 });
await mongoClient.connect();
// Any operations will reproduce the issue found in v5.0.0/v4.13.0
// it would seem the MessageStream has to be used?
await mongoClient.db().command({ ping: 1 });
await mongoClient.close();
}
);

startingMemoryUsed = res.startingMemoryUsed;
endingMemoryUsed = res.endingMemoryUsed;
heap = res.heap;
});

describe('ending memory usage', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export type ProcessResourceTestFunction = (options: {

const HEAP_RESOURCE_SCRIPT_PATH = path.resolve(
__dirname,
'../../tools/fixtures/resource_script.in.js'
'../../tools/fixtures/heap_resource_script.in.js'
);
const REPORT_RESOURCE_SCRIPT_PATH = path.resolve(
__dirname,
Expand Down
2 changes: 1 addition & 1 deletion test/tools/fixtures/heap_resource_script.in.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const driverPath = DRIVER_SOURCE_PATH;
const func = FUNCTION_STRING;
const name = NAME_STRING;
const name = SCRIPT_NAME_STRING;
const uri = URI_STRING;
const iterations = ITERATIONS_STRING;

Expand Down
Loading