Skip to content

CXX-1848 Add sharded cluster test coverage to EVG config #1007

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

Merged
merged 47 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d7454fb
Move legacy transaction spec tests into subdirectory
eramongodb Aug 1, 2023
180d361
Sync legacy transaction spec tests with 56454749 (CXX-2406)
eramongodb Aug 2, 2023
a9dfaf6
Sync legacy transactions convenient API spec tests with e9280056 (CXX…
eramongodb Aug 1, 2023
7b74f57
Remove references to obsolete "sharded-replicaset" topology
eramongodb Aug 1, 2023
6b5d658
Fix inconsistent behavior of index_view::create_*() on sharded clusters
eramongodb Aug 1, 2023
054aacf
The failCommand operation on mongos requires 4.1+
eramongodb Aug 2, 2023
817294d
Multi-document transactions require 4.2+
eramongodb Aug 2, 2023
103a177
Fix legacy test runner outcome checks missing readPreference=primary
eramongodb Aug 2, 2023
511dc9c
Fix flaky tailable await cursors tests due to extreme maxAwaitTimeMS
eramongodb Aug 2, 2023
c785376
Remove unused configureFailPoint operation in legacy test runner
eramongodb Aug 2, 2023
4fcb398
Ensure configureFailPoint events are ignored
eramongodb Aug 1, 2023
600710e
Improve apm_checker::print_all() output and const-correctness
eramongodb Aug 1, 2023
c6c5831
Capture APM events in result assertion failures
eramongodb Aug 1, 2023
3fd26cb
Use Catch2 substring matcher instead of index comparison
eramongodb Aug 1, 2023
f62058d
Fix operation name match for assertSessionUnpinned
eramongodb Aug 2, 2023
5274b1d
Update session pin assertion operations
eramongodb Aug 2, 2023
3af8d98
Do not assume session object name when not session0
eramongodb Aug 2, 2023
576bad6
Add transactions mongos pinning prose tests
eramongodb Aug 2, 2023
2b6f524
Improve failure messages for APM event checks in legacy test runner
eramongodb Aug 2, 2023
bb9cc44
Add Catch2 sections separating legacy transactions and convenient API…
eramongodb Aug 2, 2023
28f4d2f
Handle client errors reported as logic_error in legacy test runner
eramongodb Aug 2, 2023
9e61468
Skip legacy transactions test requiring explicit readPreference with …
eramongodb Aug 2, 2023
e70b90b
Update legacy transactions test runner to conform to latest spec
eramongodb Aug 2, 2023
728e40b
Implement assertSessionTransactionState in legacy test runner
eramongodb Aug 2, 2023
df3d548
Implement targetedFailPoint in legacy test runner
eramongodb Aug 2, 2023
b37a649
Sync unified transaction spec tests with 474ddfcc (CXX-2221, CXX-2233…
eramongodb Jul 27, 2023
f5c0e65
Fix unified test runner outcome checks missing readPreference=primary…
eramongodb Aug 3, 2023
8dca710
Add transactions spec tests to unified test runner
eramongodb Jul 27, 2023
750c8e5
Fix test client URI hostname specification in unified test runner
eramongodb Aug 2, 2023
3931526
Implement targetedFailPoint in unified test runner
eramongodb Aug 2, 2023
80ea004
Implement session pin assertions in unified test runner
eramongodb Aug 2, 2023
b109109
Add sharded cluster tasks to EVG config
eramongodb Jul 27, 2023
7e07d17
Merge remote-tracking branch 'upstream/master' into cxx-1848
eramongodb Aug 9, 2023
ebdbe20
Use scope guards to disable fail points in unified test runner
eramongodb Aug 8, 2023
3d818c4
Add reference to SERVER ticket in aggregation_examples.cpp
eramongodb Aug 9, 2023
e333dfd
Remove obsolete version checks in examples (CXX-1547)
eramongodb Aug 9, 2023
65ffdab
Fix server version comparisons
eramongodb Aug 9, 2023
e98258a
Add assertions verifying live mongos requirements in legacy test runner
eramongodb Aug 9, 2023
27e3e68
Improve error message on missing mongos
eramongodb Aug 9, 2023
6e76b89
Add assertion for targetedFailPoint frequency expectations
eramongodb Aug 9, 2023
09893ba
Workaround possibly unexpected multi and upsert fields
eramongodb Aug 9, 2023
fe58309
Address -Wunused-function warnings in examples
eramongodb Aug 9, 2023
f0bbfbe
Address -Wunused-parameter warnings in aggregation_examples.cpp
eramongodb Aug 9, 2023
de2e428
Fix missing dereference of pointer to targetedFailPoint guard
eramongodb Aug 9, 2023
b4f9f32
Fix match actions when comparing APM events in legacy test runner
eramongodb Aug 10, 2023
f59ffa7
Fix incorrect string comparison of multi field
eramongodb Aug 10, 2023
b3167bb
Add support for missing sessionOptions fields in legacy test runner
eramongodb Aug 10, 2023
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
61 changes: 49 additions & 12 deletions .mci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ functions:
export RETRYABLE_READS_UNIFIED_TESTS_PATH="$(pwd)/../data/retryable-reads/unified"
export RETRYABLE_WRITES_UNIFIED_TESTS_PATH="$(pwd)/../data/retryable-writes/unified"
export SESSION_UNIFIED_TESTS_PATH="$(pwd)/../data/sessions/unified"
export TRANSACTIONS_TESTS_PATH="$(pwd)/../data/transactions"
export TRANSACTIONS_LEGACY_TESTS_PATH="$(pwd)/../data/transactions/legacy"
export TRANSACTIONS_UNIFIED_TESTS_PATH="$(pwd)/../data/transactions/unified"
export UNIFIED_FORMAT_TESTS_PATH=$(pwd)/../data/unified-format
export URI_OPTIONS_TESTS_PATH="$(pwd)/../data/uri-options"
export VERSIONED_API_TESTS_PATH=$(pwd)/../data/versioned-api
Expand Down Expand Up @@ -988,6 +989,21 @@ tasks:
- func: "install_c_driver"
- func: "test"

- name: compile_and_test_with_shared_libs_sharded_cluster
commands:
- func: "setup"
- func: "start_mongod"
vars:
TOPOLOGY: "sharded_cluster"
- func: "fetch_c_driver_source"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "install_c_driver"
- func: "test"

# Auto downloading the C driver in the C++ build does not currently include
# support for libmongocrypt, therefore it is not configured with
# -DENABLE_CLIENT_SIDE_ENCRYPTION=ON. For now, CSFLE tests will need to have
Expand All @@ -1006,6 +1022,20 @@ tasks:
- func: "run_kms_servers"
- func: "test"

- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
commands:
- func: "setup"
- func: "start_mongod"
vars:
TOPOLOGY: "sharded_cluster"
- func: "install_c_driver"
- func: "compile"
vars:
RUN_DISTCHECK: 1
- func: "clone_drivers-evergreen-tools"
- func: "run_kms_servers"
- func: "test"

- name: uninstall_check
commands:
- func: "setup"
Expand Down Expand Up @@ -1314,6 +1344,12 @@ buildvariants:
tasks:
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt

- matrix_name: "integration (sharded cluster)"
matrix_spec: {os: "ubuntu-1804", mongodb_version: "*"}
display_name: "${os} sharded cluster (MongoDB ${mongodb_version})"
tasks:
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt

- matrix_name: "auth"
matrix_spec: {os: "*", mongodb_version: "latest"}
display_name: "${os} ${mongodb_version} Auth"
Expand All @@ -1327,15 +1363,6 @@ buildvariants:
- name: test_versioned_api
- name: test_versioned_api_accept_version_two

# Add matrix for specification test requirement of mongocryptd:
# "Drivers MUST run all tests with mongocryptd on at least one platform for all tested server versions (4.2+)."
- matrix_name: "mongocryptd"
matrix_spec: {os: "ubuntu-1804", mongodb_version: ["4.2", "4.4", "5.0", "latest"], use_mongocryptd: "true"}
display_name: "${os} (MongoDB ${mongodb_version}) with mongocryptd"
tasks:
- name: compile_and_test_with_shared_libs
- name: compile_and_test_with_shared_libs_replica_set

#######################################
# Linux Buildvariants #
#######################################
Expand All @@ -1358,6 +1385,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- rhel90-large
Expand All @@ -1381,6 +1409,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- rhel90-arm64-large
Expand All @@ -1403,6 +1432,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- debian11-large
Expand All @@ -1426,6 +1456,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_sharded_cluster
- name: build_example_with_add_subdirectory
distros:
- debian11-large
Expand All @@ -1447,6 +1478,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- debian10-large
Expand All @@ -1468,6 +1500,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_sharded_cluster
- name: build_example_with_add_subdirectory
distros:
- debian10-large
Expand All @@ -1479,11 +1512,11 @@ buildvariants:
matrix_spec:
os: "ubuntu-1804"
mongodb_version: ["4.2", "4.4", "5.0", "latest"]
use_mongocryptd: "true"
display_name: "${os} (MongoDB ${mongodb_version}) with mongocryptd"
tasks:
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
expansions:
use_mongocryptd: true
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt

- name: ubuntu2004-release-latest
display_name: "Ubuntu 20.04 Release (MongoDB Latest)"
Expand All @@ -1501,6 +1534,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- ubuntu2004-large
Expand All @@ -1522,6 +1556,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_sharded_cluster
- name: build_example_with_add_subdirectory
distros:
- ubuntu2004-large
Expand All @@ -1544,6 +1579,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set_with_libmongocrypt
- name: compile_and_test_with_shared_libs_sharded_cluster_with_libmongocrypt
- name: build_example_with_add_subdirectory
distros:
- ubuntu1804-build
Expand All @@ -1565,6 +1601,7 @@ buildvariants:
- name: compile_and_test_with_static_libs
- name: compile_and_test_with_static_libs_extra_alignment
- name: compile_and_test_with_shared_libs_replica_set
- name: compile_and_test_with_shared_libs_sharded_cluster
- name: build_example_with_add_subdirectory
distros:
- ubuntu1804-build
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"minServerVersion": "4.1.8",
"topology": [
"sharded"
]
],
"serverless": "forbid"
}
],
"database_name": "transaction-tests",
Expand Down Expand Up @@ -102,7 +103,7 @@
}
},
{
"description": "NotMaster errors contain transient label",
"description": "NotWritablePrimary errors contain transient label",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
Expand Down Expand Up @@ -962,12 +963,12 @@
"failCommands": [
"commitTransaction"
],
"errorLabels": [
"RetryableWriteError"
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down",
"errorLabels": [
"RetryableWriteError"
]
"errmsg": "Replication is being shut down"
}
}
},
Expand Down
96 changes: 96 additions & 0 deletions data/transactions/legacy/errors-client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"runOn": [
{
"minServerVersion": "4.0",
"topology": [
"replicaset"
]
},
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
]
}
],
"database_name": "transaction-tests",
"collection_name": "test",
"data": [],
"tests": [
{
"description": "Client side error in command starting transaction",
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "updateOne",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 1
},
"update": {
"x": 1
}
},
"error": true
},
{
"name": "assertSessionTransactionState",
"object": "testRunner",
"arguments": {
"session": "session0",
"state": "starting"
}
}
]
},
{
"description": "Client side error when transaction is in progress",
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "updateOne",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 1
},
"update": {
"x": 1
}
},
"error": true
},
{
"name": "assertSessionTransactionState",
"object": "testRunner",
"arguments": {
"session": "session0",
"state": "in_progress"
}
}
]
}
]
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"minServerVersion": "4.1.8",
"topology": [
"sharded"
]
],
"serverless": "forbid"
}
],
"database_name": "transaction-tests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"minServerVersion": "4.1.8",
"topology": [
"sharded"
]
],
"serverless": "forbid"
}
],
"database_name": "transaction-tests",
Expand Down Expand Up @@ -179,6 +180,9 @@
"failCommands": [
"commitTransaction"
],
"errorLabels": [
"RetryableWriteError"
],
"writeConcernError": {
"code": 91,
"errmsg": "Replication is being shut down"
Expand Down Expand Up @@ -303,7 +307,8 @@
"data": {
"failCommands": [
"commitTransaction",
"isMaster"
"isMaster",
"hello"
],
"closeConnection": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"minServerVersion": "4.1.8",
"topology": [
"sharded"
]
],
"serverless": "forbid"
}
],
"database_name": "transaction-tests",
Expand Down Expand Up @@ -875,7 +876,7 @@
"failCommands": [
"commitTransaction"
],
"errorCode": 50
"errorCode": 51
}
}
}
Expand All @@ -887,7 +888,7 @@
"errorLabelsOmit": [
"TransientTransactionError"
],
"errorCode": 50
"errorCode": 51
}
},
{
Expand Down Expand Up @@ -1106,7 +1107,8 @@
"data": {
"failCommands": [
"insert",
"isMaster"
"isMaster",
"hello"
],
"closeConnection": true
}
Expand Down
File renamed without changes.
Loading