Skip to content
Open
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
62 changes: 62 additions & 0 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,67 @@ functions:
script: |
bash ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh

# Disaggregated storage (DSC) deployment: a three-member replica set backed by SLS, run in containers.
# See drivers-evergreen-tools/.evergreen/disagg/README.md and "Disaggregated storage (DSC)" in test/readme.md.
"start dsc":
# The SLS images are in a private ECR registry that requires this role.
- command: ec2.assume_role
params:
role_arn: arn:aws:iam::664315256653:role/disagg-storage-tf-project-ro
- command: subprocess.exec
type: setup
params:
working_dir: src
binary: bash
include_expansions_in_env:
[AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, DSC_SLS_TAG]
args:
- ${DRIVERS_TOOLS}/.evergreen/disagg/setup.sh
# setup.sh writes MONGODB_URI for the deployment
- command: expansions.update
params:
file: src/dsc-expansion.yml

# mongo-orchestration does not run in DSC tasks, so fetch crypt_shared (CRYPT_SHARED_LIB_PATH) directly.
"fetch dsc crypt_shared":
# Downloads of the "latest" crypt_shared require AWS credentials (DRIVERS-3628).
- <<: *assume_secrets_manager_role
- command: subprocess.exec
type: setup
params:
working_dir: src
binary: bash
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
args:
- ${DRIVERS_TOOLS}/.evergreen/disagg/download-crypt.sh
- command: expansions.update
params:
file: src/crypt-shared-expansion.yml

# Runs in `post` for every task, so it only acts in DSC tasks (DSC=on).
"stop dsc":
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
if [[ "${DSC|}" == "on" ]]; then
bash ${DRIVERS_TOOLS}/.evergreen/disagg/teardown.sh
fi
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/sls-logs.txt.gz
optional: true
# Not under mongo-node-driver/${revision}/${version_id}/: "download and merge coverage" downloads
# everything under that prefix and treats every file as a coverage report.
remote_file: mongo-node-driver/dsc-logs/${version_id}/${task_id}-${execution}-sls-logs.txt.gz
bucket: mciuploads
permissions: public-read
content_type: application/x-gzip
display_name: "sls-logs.txt.gz"

"bootstrap mongohoused":
- <<: *assume_secrets_manager_role
- command: shell.exec
Expand Down Expand Up @@ -1408,6 +1469,7 @@ post:
- func: "reset aws instance profile"
- func: "upload test results"
- func: "stop mongo-orchestration"
- func: "stop dsc"
- func: "upload coverage report"
- func: "cleanup"

Expand Down
88 changes: 88 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,63 @@ functions:
params:
script: |
bash ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh
start dsc:
- command: ec2.assume_role
params:
role_arn: arn:aws:iam::664315256653:role/disagg-storage-tf-project-ro
- command: subprocess.exec
type: setup
params:
working_dir: src
binary: bash
include_expansions_in_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- DSC_SLS_TAG
args:
- ${DRIVERS_TOOLS}/.evergreen/disagg/setup.sh
- command: expansions.update
params:
file: src/dsc-expansion.yml
fetch dsc crypt_shared:
- command: ec2.assume_role
params:
role_arn: ${DRIVERS_SECRETS_ARN}
- command: subprocess.exec
type: setup
params:
working_dir: src
binary: bash
include_expansions_in_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
args:
- ${DRIVERS_TOOLS}/.evergreen/disagg/download-crypt.sh
- command: expansions.update
params:
file: src/crypt-shared-expansion.yml
stop dsc:
- command: shell.exec
params:
working_dir: src
shell: bash
script: |
if [[ "${DSC|}" == "on" ]]; then
bash ${DRIVERS_TOOLS}/.evergreen/disagg/teardown.sh
fi
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: src/sls-logs.txt.gz
optional: true
remote_file: mongo-node-driver/dsc-logs/${version_id}/${task_id}-${execution}-sls-logs.txt.gz
bucket: mciuploads
permissions: public-read
content_type: application/x-gzip
display_name: sls-logs.txt.gz
bootstrap mongohoused:
- command: ec2.assume_role
params:
Expand Down Expand Up @@ -2576,6 +2633,28 @@ tasks:
- name: run-lint-checks
variant: lint
patch_optional: true
- name: test-dsc-replica_set
tags:
- dsc
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: DSC, value: 'on'}
- {key: DSC_SLS_TAG, value: linux-x86-64-f987ae59a6f61e0b4e3edc73663992e15c4e9261}
- {key: AUTH, value: noauth}
- {key: SSL, value: nossl}
- {key: CLIENT_ENCRYPTION, value: 'true'}
- {key: TEST_CSFLE, value: 'true'}
- func: install dependencies
- func: start dsc
- func: fetch dsc crypt_shared
- func: run tests
depends_on:
- name: run-lint-checks
variant: lint
patch_optional: true
- name: test-latest-server-noauth
tags:
- latest
Expand Down Expand Up @@ -4139,6 +4218,7 @@ post:
- func: reset aws instance profile
- func: upload test results
- func: stop mongo-orchestration
- func: stop dsc
- func: upload coverage report
- func: cleanup
ignore:
Expand Down Expand Up @@ -4744,6 +4824,14 @@ buildvariants:
run_on: rhel80-large
tasks:
- test_atlas_task_group_search_indexes
- name: ubuntu2404-test-dsc
display_name: Disaggregated Storage (DSC) Tests
run_on: ubuntu2404-large
expansions:
NODE_LTS_VERSION: 24
batchtime: 1440
tasks:
- .dsc
- name: resource management tests
display_name: resource management tests
run_on: rhel80-large
Expand Down
36 changes: 36 additions & 0 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,42 @@ BUILD_VARIANTS.push({
tasks: ['test_atlas_task_group_search_indexes']
});

// Disaggregated storage (DSC): the full integration suite against a three-member replica set backed by SLS.
// DSC has no auth, TLS, standalone, or sharded deployments. See "Disaggregated storage (DSC)" in test/readme.md.
SINGLETON_TASKS.push({
name: 'test-dsc-replica_set',
tags: ['dsc'],
commands: [
updateExpansions({
DSC: 'on',
// Without a pinned tag, setup.sh picks the newest SLS image, and recent images fail to start
// (StartLog "store_id mismatch"). Same tag as the C driver's DSC tasks (mongo-c-driver#2552).
DSC_SLS_TAG: 'linux-x86-64-f987ae59a6f61e0b4e3edc73663992e15c4e9261',
AUTH: 'noauth',
SSL: 'nossl',
CLIENT_ENCRYPTION: true,
TEST_CSFLE: true
}),
{ func: 'install dependencies' },
{ func: 'start dsc' },
{ func: 'fetch dsc crypt_shared' },
{ func: 'run tests' }
]
});

BUILD_VARIANTS.push({
name: 'ubuntu2404-test-dsc',
display_name: 'Disaggregated Storage (DSC) Tests',
// The SLS containers need an x86_64 Linux host with Docker.
run_on: 'ubuntu2404-large',
expansions: {
NODE_LTS_VERSION: LATEST_LTS
},
// Not yet stable: at most once a day on mainline.
batchtime: 1440,
tasks: ['.dsc']
});

BUILD_VARIANTS.push({
name: 'resource management tests',
display_name: 'resource management tests',
Expand Down
2 changes: 2 additions & 0 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set -o errexit # Exit the script with error if any of the commands fail
# MARCH Machine Architecture. Defaults to lowercase uname -m
# SKIP_DEPS Skip installing dependencies
# TEST_CSFLE Set to enforce running csfle tests
# DSC Set to "on" when MONGODB_URI is a disaggregated storage (DSC) deployment

AUTH=${AUTH:-noauth}
MONGODB_URI=${MONGODB_URI:-}
Expand Down Expand Up @@ -70,4 +71,5 @@ export MONGODB_URI=${MONGODB_URI}
export LOAD_BALANCER=${LOAD_BALANCER}
export TEST_CSFLE=${TEST_CSFLE}
export COMPRESSOR=${COMPRESSOR}
export DSC=${DSC}
npm run check:integration-coverage
6 changes: 6 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ declare global {
libmongocrypt?: string;

tls?: 'enabled' | 'disabled';

/**
* 'enabled' runs the test only against a disaggregated storage deployment (DSC),
* 'disabled' never runs it against one. Set by `DSC=on`; see test/readme.md.
*/
dsc?: 'enabled' | 'disabled';
};

sessions?: {
Expand Down
12 changes: 8 additions & 4 deletions test/integration/change-streams/change_stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2292,7 +2292,8 @@ describe('ChangeStream resumability', function () {
context('when the error is not a server error', function () {
it(
'should resume on ServerSelectionError',
{ requires: { topology: ['replicaset'] } },
// DSC test deployments have no electable secondary, so replSetStepDown fails
{ requires: { topology: ['replicaset'], dsc: 'disabled' } },
async function () {
changeStream = collection.watch([]);
await initIteratorMode(changeStream);
Expand Down Expand Up @@ -2621,7 +2622,8 @@ describe('ChangeStream resumability', function () {
context('when the error is not a server error', function () {
it(
'should resume on ServerSelectionError',
{ requires: { topology: ['replicaset'] } },
// DSC test deployments have no electable secondary, so replSetStepDown fails
{ requires: { topology: ['replicaset'], dsc: 'disabled' } },
async function () {
changeStream = collection.watch([]);
await initIteratorMode(changeStream);
Expand Down Expand Up @@ -2782,7 +2784,8 @@ describe('ChangeStream resumability', function () {
context('when the error is not a server error', function () {
it(
'should resume on ServerSelectionError',
{ requires: { topology: ['replicaset'] } },
// DSC test deployments have no electable secondary, so replSetStepDown fails
{ requires: { topology: ['replicaset'], dsc: 'disabled' } },
async function () {
changeStream = collection.watch([]);
await initIteratorMode(changeStream);
Expand Down Expand Up @@ -2996,7 +2999,8 @@ describe('ChangeStream resumability', function () {
context('when the error is not a server error', function () {
it(
'should resume on ServerSelectionError',
{ requires: { topology: ['replicaset'] } },
// DSC test deployments have no electable secondary, so replSetStepDown fails
{ requires: { topology: ['replicaset'], dsc: 'disabled' } },
async function () {
changeStream = collection.watch([]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ describe('Connections Survive Primary Step Down - prose', function () {
client.on('connectionPoolCleared', poolClearEvent => poolClearedEvents.push(poolClearEvent));
});

context('getMore Iteration', { requires: { topology: ['replicaset'] } }, () => {
context('getMore Iteration', { requires: { topology: ['replicaset'], dsc: 'disabled' } }, () => {
// This test requires a replica set.
// It uses replSetStepDown, which fails on DSC test deployments (they have no electable secondary).

let cursor: FindCursor;
afterEach(() => cursor.close());
Expand Down
4 changes: 3 additions & 1 deletion test/integration/crud/misc_cursors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ describe('Cursor', function () {
});

it('should correctly execute cursor count with secondary readPreference', {
metadata: { requires: { topology: 'replicaset' } },
// The lookup below only maps 127.0.0.1 to localhost; the DSC replica set members have other
// hostnames (shard1-node1-mongod), so the selected server is not found.
metadata: { requires: { topology: 'replicaset', dsc: 'disabled' } },
async test() {
const bag = [];
client.on('commandStarted', filterForCommands(['count'], bag));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import * as sinon from 'sinon';

import { MongoClient } from '../../mongodb';

const metadata: MongoDBMetadataUI = { requires: { topology: '!single', tls: 'disabled' } };
// The SRV records of test1.test.build.10gen.cc point at a replica set on localhost:27017 and 27018,
// which DSC tasks do not have.
const metadata: MongoDBMetadataUI = {
requires: { topology: '!single', tls: 'disabled', dsc: 'disabled' }
};

// This serves as a placeholder for _whatever_ node.js may throw. We only rely upon `.code`
class DNSTimeoutError extends Error {
Expand Down
13 changes: 9 additions & 4 deletions test/integration/node-specific/client_close.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,16 @@ describe('MongoClient.close() Integration', () => {
expect(client.s.sessionPool.sessions).to.have.length.greaterThan(0);
});

it('does not execute endSessions', { requires: { tls: 'disabled' } }, async function () {
await client.close();
// Spawns mongocryptd from PATH, and DSC tasks do not download server binaries.
it(
'does not execute endSessions',
{ requires: { tls: 'disabled', dsc: 'disabled' } },
async function () {
await client.close();

expect(commands).to.deep.equal([]);
});
expect(commands).to.deep.equal([]);
}
);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/integration/node-specific/mongo_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ describe('class MongoClient', function () {
it('throws ENOTFOUND error when connecting to non-existent host with no auth and loadBalanced=true', async function () {
const configuration = this.configuration;
const client = configuration.newClient(
'mongodb://iLoveJavaScript:27017/test?loadBalanced=true',
'mongodb://iLoveJavaScript.invalid:27017/test?loadBalanced=true',
{ serverSelectionTimeoutMS: 100 }
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { expect } from 'chai';
import { MongoClient } from '../../mongodb';
import { configureMongocryptdSpawnHooks } from '../../tools/utils';

// These tests spawn mongocryptd from PATH, and DSC tasks do not download server binaries.
const mongocryptdMetadata: MongoDBMetadataUI = { requires: { mongodb: '>=4.4', dsc: 'disabled' } };

describe('class ServerDescription', function () {
describe('when connecting to mongocryptd', { requires: { mongodb: '>=4.4' } }, function () {
describe('when connecting to mongocryptd', mongocryptdMetadata, function () {
let client: MongoClient;

const { port: mongocryptdTestPort } = configureMongocryptdSpawnHooks();
Expand Down
Loading
Loading