diff --git a/.evergreen/config.in.yml b/.evergreen/config.in.yml index 141e6be2024..d33a23fc37a 100644 --- a/.evergreen/config.in.yml +++ b/.evergreen/config.in.yml @@ -1103,6 +1103,7 @@ functions: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} MONGODB_URI: ${MONGODB_URI} DRIVERS_TOOLS: ${DRIVERS_TOOLS} + MONGODB_CLIENT_OPTIONS: ${MONGODB_CLIENT_OPTIONS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/run-benchmarks.sh @@ -1168,6 +1169,50 @@ tasks: params: file: src/results.json + - name: run-spec-benchmark-tests-node-server-timeoutMS-120000 + tags: + - run-spec-benchmark-tests + - performance + exec_timeout_secs: 3600 + commands: + - command: expansions.update + type: setup + params: + updates: + - { key: NODE_LTS_VERSION, value: v22.11.0 } + - { key: VERSION, value: v6.0-perf } + - { key: TOPOLOGY, value: server } + - { key: AUTH, value: noauth } + - { key: MONGODB_CLIENT_OPTIONS, value: '{"timeoutMS": 120000}' } + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run spec driver benchmarks + - command: perf.send + params: + file: src/results.json + + - name: run-spec-benchmark-tests-node-server-timeoutMS-0 + tags: + - run-spec-benchmark-tests + - performance + exec_timeout_secs: 3600 + commands: + - command: expansions.update + type: setup + params: + updates: + - { key: NODE_LTS_VERSION, value: v22.11.0 } + - { key: VERSION, value: v6.0-perf } + - { key: TOPOLOGY, value: server } + - { key: AUTH, value: noauth } + - { key: MONGODB_CLIENT_OPTIONS, value: '{"timeoutMS": 0}' } + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run spec driver benchmarks + - command: perf.send + params: + file: src/results.json + - name: "test-gcpkms-task" commands: - command: expansions.update @@ -1300,7 +1345,7 @@ tasks: include_expansions_in_env: ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"] args: - .evergreen/run-oidc-tests-k8s.sh - + - name: "oidc-auth-test-k8s-latest-aks" commands: - func: "install dependencies" @@ -1736,3 +1781,5 @@ buildvariants: run_on: rhel90-dbx-perf-large tasks: - run-spec-benchmark-tests-node-server + - run-spec-benchmark-tests-node-server-timeoutMS-120000 + - run-spec-benchmark-tests-node-server-timeoutMS-0 diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 02eec1dc349..2832c81a396 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1065,6 +1065,7 @@ functions: PROJECT_DIRECTORY: ${PROJECT_DIRECTORY} MONGODB_URI: ${MONGODB_URI} DRIVERS_TOOLS: ${DRIVERS_TOOLS} + MONGODB_CLIENT_OPTIONS: ${MONGODB_CLIENT_OPTIONS} binary: bash args: - ${PROJECT_DIRECTORY}/.evergreen/run-benchmarks.sh @@ -1128,6 +1129,48 @@ tasks: - command: perf.send params: file: src/results.json + - name: run-spec-benchmark-tests-node-server-timeoutMS-120000 + tags: + - run-spec-benchmark-tests + - performance + exec_timeout_secs: 3600 + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: NODE_LTS_VERSION, value: v22.11.0} + - {key: VERSION, value: v6.0-perf} + - {key: TOPOLOGY, value: server} + - {key: AUTH, value: noauth} + - {key: MONGODB_CLIENT_OPTIONS, value: '{"timeoutMS": 120000}'} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run spec driver benchmarks + - command: perf.send + params: + file: src/results.json + - name: run-spec-benchmark-tests-node-server-timeoutMS-0 + tags: + - run-spec-benchmark-tests + - performance + exec_timeout_secs: 3600 + commands: + - command: expansions.update + type: setup + params: + updates: + - {key: NODE_LTS_VERSION, value: v22.11.0} + - {key: VERSION, value: v6.0-perf} + - {key: TOPOLOGY, value: server} + - {key: AUTH, value: noauth} + - {key: MONGODB_CLIENT_OPTIONS, value: '{"timeoutMS": 0}'} + - func: install dependencies + - func: bootstrap mongo-orchestration + - func: run spec driver benchmarks + - command: perf.send + params: + file: src/results.json - name: test-gcpkms-task commands: - command: expansions.update @@ -4670,6 +4713,8 @@ buildvariants: run_on: rhel90-dbx-perf-large tasks: - run-spec-benchmark-tests-node-server + - run-spec-benchmark-tests-node-server-timeoutMS-120000 + - run-spec-benchmark-tests-node-server-timeoutMS-0 - name: rhel80-large-gallium display_name: rhel8 Node16 run_on: rhel80-large diff --git a/.evergreen/run-benchmarks.sh b/.evergreen/run-benchmarks.sh index 52201032813..a9db937f4bb 100644 --- a/.evergreen/run-benchmarks.sh +++ b/.evergreen/run-benchmarks.sh @@ -7,6 +7,7 @@ set -o nounset source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh export MONGODB_URI=$MONGODB_URI +export MONGODB_CLIENT_OPTIONS=$MONGODB_CLIENT_OPTIONS npm run build:ts npm run check:bench diff --git a/test/benchmarks/driverBench/common.js b/test/benchmarks/driverBench/common.js index bb5b48babfd..d4abaac5e63 100644 --- a/test/benchmarks/driverBench/common.js +++ b/test/benchmarks/driverBench/common.js @@ -23,8 +23,22 @@ function loadSpecString(filePath) { return loadSpecFile(filePath, 'utf8'); } +const MONGODB_CLIENT_OPTIONS = (() => { + const optionsString = process.env.MONGODB_CLIENT_OPTIONS; + let options = undefined; + if (optionsString?.length) { + options = JSON.parse(optionsString); + } + return { ...options }; +})(); + +const MONGODB_URI = (() => { + if (process.env.MONGODB_URI?.length) return process.env.MONGODB_URI; + return 'mongodb://127.0.0.1:27017'; +})(); + function makeClient() { - this.client = new MongoClient(process.env.MONGODB_URI || 'mongodb://127.0.0.1:27017'); + this.client = new MongoClient(MONGODB_URI, MONGODB_CLIENT_OPTIONS); } function connectClient() { @@ -101,6 +115,8 @@ async function writeSingleByteFileToBucket() { } module.exports = { + MONGODB_URI, + MONGODB_CLIENT_OPTIONS, makeClient, connectClient, disconnectClient, diff --git a/test/benchmarks/driverBench/index.js b/test/benchmarks/driverBench/index.js index 5b343cb2be1..928ba31bd86 100644 --- a/test/benchmarks/driverBench/index.js +++ b/test/benchmarks/driverBench/index.js @@ -8,9 +8,9 @@ const Runner = MongoBench.Runner; let bsonType = 'js-bson'; // TODO(NODE-4606): test against different driver configurations in CI -const { inspect } = require('util'); const { writeFile } = require('fs/promises'); const { makeParallelBenchmarks, makeSingleBench, makeMultiBench } = require('../mongoBench/suites'); +const { MONGODB_CLIENT_OPTIONS } = require('./common'); const hw = os.cpus(); const ram = os.totalmem() / 1024 ** 3; @@ -89,7 +89,15 @@ benchmarkRunner return { info: { test_name: benchmarkName, - tags: [bsonType] + tags: [bsonType], + // Args can only be a map of string -> int32. So if its a number leave it be, + // if it is anything else test for truthiness and set to 1 or 0. + args: Object.fromEntries( + Object.entries(MONGODB_CLIENT_OPTIONS).map(([key, value]) => [ + key, + typeof value === 'number' ? value | 0 : value ? 1 : 0 + ]) + ) }, metrics: [{ name: 'megabytes_per_second', value: result }] }; @@ -97,7 +105,6 @@ benchmarkRunner }) .then(data => { const results = JSON.stringify(data, undefined, 2); - console.log(inspect(data, { depth: Infinity, colors: true })); return writeFile('results.json', results); }) .catch(err => console.error(err)); diff --git a/test/benchmarks/mongoBench/runner.js b/test/benchmarks/mongoBench/runner.js index 745cefa74e8..b3e3c5cd6aa 100644 --- a/test/benchmarks/mongoBench/runner.js +++ b/test/benchmarks/mongoBench/runner.js @@ -190,8 +190,8 @@ class Runner { _errorHandler(error) { this.reporter(`Error: ${error.name} - ${error.message} - ${error.stack}`); - for (let error = error.cause; error != null; error = error.cause) { - this.reporter(`Caused by: ${error.name} - ${error.message} - ${error.stack}`); + for (let cause = error.cause; cause != null; cause = cause.cause) { + this.reporter(`Caused by: ${cause.name} - ${cause.message} - ${cause.stack}`); } throw error; }