Compare commits

...

1 Commits

Author SHA1 Message Date
Cloud User
263c72e2d2 resyncing specs test? 2025-06-25 17:47:01 +00:00
60 changed files with 11600 additions and 1370 deletions

View File

@ -42,3 +42,23 @@ post:
- func: "upload mo artifacts"
- func: "upload test results"
- func: "cleanup"
tasks:
- name: resync_specs
commands:
- command: subprocess.exec
params:
binary: bash
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
args:
- .evergreen/scripts/resync-all-specs.sh
working_dir: src
buildvariants:
- name: resync_specs
display_name: "Resync Specs"
run_on: rhel80-small
cron: '0 9 * * MON'
patchable: true
tasks:
- name: resync_specs

View File

@ -45,9 +45,12 @@ then
fi
# Ensure the JSON files are up to date.
cd $SPECS/source
make
cd -
if ! [ -n "${CI:-}" ]
then
cd $SPECS/source
make
cd -
fi
# cpjson unified-test-format/tests/invalid unified-test-format/invalid
# * param1: Path to spec tests dir in specifications repo
# * param2: Path to where the corresponding tests live in Python.

63
.evergreen/scripts/create-pr.sh Executable file
View File

@ -0,0 +1,63 @@
#!/usr/bin/env bash
tools="../drivers-evergreen-tools"
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $tools
body="$(cat "$1")"
pushd $tools/.evergreen/github_app
owner="mongodb"
repo="mongo-python-driver"
# Bootstrap the app.
echo "bootstrapping"
source utils.sh
bootstrap drivers/comment-bot
# Run the app.
source ./secrets-export.sh
# Get a github access token for the git checkout.
echo "Getting github token..."
token=$(bash ./get-access-token.sh $repo $owner)
if [ -z "${token}" ]; then
echo "Failed to get github access token!"
popd
exit 1
fi
echo "Getting github token... done."
popd
# Make the git checkout and create a new branch.
echo "Creating the git checkout..."
branch="spec-resync-"$(date '+%m-%d-%Y')
#git config user.email "167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com"
#git config user.name "mongodb-dbx-release-bot[bot]"
git remote set-url origin https://x-access-token:${token}@github.com/$owner/$repo.git
git checkout -b $branch "origin/master"
git add ./test
git apply -R .evergreen/specs.patch
git commit -am "resyncing specs test?"
echo "Creating the git checkout... done."
echo "THIS IS THE BODY"
echo "$body"
git push origin $branch
echo "{\"title\":\"[Spec Resync] $(date '+%m-%d-%Y')\",\"body\":\"$(cat "$1")\",\"head\":\"${branch}\",\"base\":\"master\"}"
resp=$(curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $token" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-d "{\"title\":\"[Spec Resync] $(date '+%m-%d-%Y')\",\"body\":\"$(cat "$1")\",\"head\":\"${branch}\",\"base\":\"master\"}" \
--url https://api.github.com/repos/$owner/$repo/pulls)
echo $resp
echo $resp | jq '.html_url'
echo "Creating the PR... done."
rm -rf $tools
# use file names or reg-ex patterns
# or automate which version of the spec we support (like schema version)

View File

@ -0,0 +1,59 @@
import os
import pathlib
import subprocess
import argparse
def resync_specs(directory: pathlib.Path, succeeded: list[str], errored: dict[str, str]) -> None:
for entry in os.scandir(directory):
if not entry.is_dir():
continue
print(entry.path)
spec_name = entry.path.split("/")[-1]
if spec_name in ["asynchronous"]:
continue
process = subprocess.run(
["bash", "./.evergreen/resync-specs.sh", spec_name],
capture_output=True,
text=True)
print(process.returncode)
if process.returncode == 0:
succeeded.append(spec_name)
else:
errored[spec_name] = process.stdout
print(process.stderr)
def write_summary(succeeded: list[str], errored: dict[str, str]) -> None:
pr_body = ""
if len(succeeded) > 0:
pr_body += "The following specs were changed:\n- "
process = subprocess.run(
["git diff --name-only | awk -F'/' '{print $2}' | sort | uniq"],
shell=True,
capture_output=True,
text=True)
pr_body += process.stdout.strip().replace("\n", "\n- ")
pr_body += "\n"
if len(errored) > 0:
pr_body += "\n\nThe following spec syncs encountered errors:"
for k, v in errored.items():
pr_body += f"\n- {k}\n```{v}\n```"
if pr_body != "":
with open("spec_sync.txt", "w") as f:
# replacements made for to be json
f.write(pr_body.replace("\n", "\\n").replace("\t", "\\t"))
def main():
directory = pathlib.Path("./test")
succeeded: list[str] = []
errored: dict[str, str] = {}
resync_specs(directory, succeeded, errored)
write_summary(succeeded, errored)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Python Script to resync all specs and generate summary for PR.")
parser.add_argument("filename", help="Name of file for the summary to be written into.")
args = parser.parse_args()
main()

View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Run spec syncing script and create PR
# SETUP
SPEC_DEST="$(realpath -s "./test")"
SRC_URL="https://github.com/mongodb/specifications.git"
# needs to be set for resunc-specs.sh
SPEC_SRC="$(realpath -s "../specifications")"
SCRIPT="$(realpath -s "./.evergreen/resync-specs.sh")"
BRANCH_NAME="spec-resync-"$(date '+%m-%d-%Y')
# Clone the spec repo if the directory does not exist
if [[ ! -d $SPEC_SRC ]]; then
git clone $SRC_URL $SPEC_SRC
if [[ $? -ne 0 ]]; then
echo "Error: Failed to clone repository."
exit 1
fi
fi
# Set environment variable to the cloned spec repo for resync-specs.sh
export MDB_SPECS="$SPEC_SRC"
# Check that resync-specs.sh exists and is executable
if [[ ! -x $SCRIPT ]]; then
echo "Error: $SCRIPT not found or is not executable."
exit 1
fi
PR_DESC="spec_sync.txt"
# run python script that actually does all the resyncing
/opt/devtools/bin/python3.11 ./.evergreen/scripts/resync-all-specs.py "$PR_DESC"
if [[ -f $PR_DESC ]]; then
# changes were made -> call scrypt to create PR for us
.evergreen/scripts/create-pr.sh "$PR_DESC"
rm "$PR_DESC"
fi

1327
.evergreen/specs.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,15 @@
"padding": 3,
"canonical_bson": "1600000005766563746F7200040000000910037F0800"
},
{
"description": "PACKED_BIT with inconsistent padding",
"valid": false,
"vector": [127, 7],
"dtype_hex": "0x10",
"dtype_alias": "PACKED_BIT",
"padding": 3,
"canonical_bson": "1600000005766563746F7200040000000910037F0700"
},
{
"description": "Empty Vector PACKED_BIT",
"valid": true,

View File

@ -24,6 +24,7 @@
{
"description" : "Y10K",
"canonical_bson" : "1000000009610000DC1FD277E6000000",
"relaxed_extjson" : "{\"a\":{\"$date\":{\"$numberLong\":\"253402300800000\"}}}",
"canonical_extjson" : "{\"a\":{\"$date\":{\"$numberLong\":\"253402300800000\"}}}"
},
{

View File

@ -312,6 +312,30 @@
"canonical_bson": "18000000136400000000000a5bc138938d44c64d31cc3700",
"degenerate_extjson": "{\"d\" : {\"$numberDecimal\" : \"1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\"}}",
"canonical_extjson": "{\"d\" : {\"$numberDecimal\" : \"1.000000000000000000000000000000000E+999\"}}"
},
{
"description": "Clamped zeros with a large positive exponent",
"canonical_bson": "180000001364000000000000000000000000000000FE5F00",
"degenerate_extjson": "{\"d\" : {\"$numberDecimal\" : \"0E+2147483647\"}}",
"canonical_extjson": "{\"d\" : {\"$numberDecimal\" : \"0E+6111\"}}"
},
{
"description": "Clamped zeros with a large negative exponent",
"canonical_bson": "180000001364000000000000000000000000000000000000",
"degenerate_extjson": "{\"d\" : {\"$numberDecimal\" : \"0E-2147483647\"}}",
"canonical_extjson": "{\"d\" : {\"$numberDecimal\" : \"0E-6176\"}}"
},
{
"description": "Clamped negative zeros with a large positive exponent",
"canonical_bson": "180000001364000000000000000000000000000000FEDF00",
"degenerate_extjson": "{\"d\" : {\"$numberDecimal\" : \"-0E+2147483647\"}}",
"canonical_extjson": "{\"d\" : {\"$numberDecimal\" : \"-0E+6111\"}}"
},
{
"description": "Clamped negative zeros with a large negative exponent",
"canonical_bson": "180000001364000000000000000000000000000000008000",
"degenerate_extjson": "{\"d\" : {\"$numberDecimal\" : \"-0E-2147483647\"}}",
"canonical_extjson": "{\"d\" : {\"$numberDecimal\" : \"-0E-6176\"}}"
}
]
}

View File

@ -0,0 +1,118 @@
{
"description": "modifyCollection-errorResponse",
"schemaVersion": "1.12",
"createEntities": [
{
"client": {
"id": "client0",
"observeEvents": [
"commandStartedEvent"
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "collMod-tests"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test"
}
}
],
"initialData": [
{
"collectionName": "test",
"databaseName": "collMod-tests",
"documents": [
{
"_id": 1,
"x": 1
},
{
"_id": 2,
"x": 1
}
]
}
],
"tests": [
{
"description": "modifyCollection prepareUnique violations are accessible",
"runOnRequirements": [
{
"minServerVersion": "5.2"
}
],
"operations": [
{
"name": "createIndex",
"object": "collection0",
"arguments": {
"keys": {
"x": 1
}
}
},
{
"name": "modifyCollection",
"object": "database0",
"arguments": {
"collection": "test",
"index": {
"keyPattern": {
"x": 1
},
"prepareUnique": true
}
}
},
{
"name": "insertOne",
"object": "collection0",
"arguments": {
"document": {
"_id": 3,
"x": 1
}
},
"expectError": {
"errorCode": 11000
}
},
{
"name": "modifyCollection",
"object": "database0",
"arguments": {
"collection": "test",
"index": {
"keyPattern": {
"x": 1
},
"unique": true
}
},
"expectError": {
"isClientError": false,
"errorCode": 359,
"errorResponse": {
"violations": [
{
"ids": [
1,
2
]
}
]
}
}
}
]
}
]
}

View File

@ -255,7 +255,7 @@
"description": "createCollection with bucketing options",
"runOnRequirements": [
{
"minServerVersion": "7.0"
"minServerVersion": "6.3"
}
],
"operations": [

View File

@ -446,6 +446,22 @@
}
}
},
{
"level": "debug",
"component": "connection",
"data": {
"message": "Connection pool cleared",
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
},
{
"level": "debug",
"component": "connection",
@ -498,26 +514,10 @@
]
}
}
},
{
"level": "debug",
"component": "connection",
"data": {
"message": "Connection pool cleared",
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
}
]
}
}

View File

@ -23,6 +23,7 @@
}
},
"poolOptions": {
"maxConnecting": 2,
"maxPoolSize": 10,
"waitQueueTimeoutMS": 5000
},
@ -72,9 +73,8 @@
"connection": "conn0"
},
{
"name": "waitForEvent",
"event": "ConnectionCheckedOut",
"count": 4
"name": "wait",
"ms": 100
}
],
"events": [
@ -104,14 +104,6 @@
"type": "ConnectionCheckedOut",
"connectionId": 1,
"address": 42
},
{
"type": "ConnectionCheckedOut",
"address": 42
},
{
"type": "ConnectionCheckedOut",
"address": 42
}
],
"ignore": [

View File

@ -49,15 +49,15 @@
"type": "ConnectionCreated",
"address": 42
},
{
"type": "ConnectionPoolCleared",
"address": 42
},
{
"type": "ConnectionClosed",
"address": 42,
"connectionId": 42,
"reason": "error"
},
{
"type": "ConnectionPoolCleared",
"address": 42
}
],
"ignore": [

View File

@ -0,0 +1,196 @@
{
"version": 1,
"style": "unit",
"description": "must issue Connections to threads in the order that the threads entered the queue",
"poolOptions": {
"maxPoolSize": 1,
"waitQueueTimeoutMS": 5000
},
"operations": [
{
"name": "ready"
},
{
"name": "checkOut",
"label": "conn0"
},
{
"name": "start",
"target": "thread1"
},
{
"name": "checkOut",
"thread": "thread1",
"label": "conn1"
},
{
"name": "waitForEvent",
"event": "ConnectionCheckOutStarted",
"count": 2
},
{
"name": "wait",
"ms": 100
},
{
"name": "start",
"target": "thread2"
},
{
"name": "checkOut",
"thread": "thread2",
"label": "conn2"
},
{
"name": "waitForEvent",
"event": "ConnectionCheckOutStarted",
"count": 3
},
{
"name": "wait",
"ms": 100
},
{
"name": "start",
"target": "thread3"
},
{
"name": "checkOut",
"thread": "thread3",
"label": "conn3"
},
{
"name": "waitForEvent",
"event": "ConnectionCheckOutStarted",
"count": 4
},
{
"name": "wait",
"ms": 100
},
{
"name": "start",
"target": "thread4"
},
{
"name": "checkOut",
"thread": "thread4",
"label": "conn4"
},
{
"name": "waitForEvent",
"event": "ConnectionCheckOutStarted",
"count": 5
},
{
"name": "wait",
"ms": 100
},
{
"name": "checkIn",
"connection": "conn0"
},
{
"name": "waitForThread",
"target": "thread1"
},
{
"name": "checkIn",
"connection": "conn1"
},
{
"name": "waitForThread",
"target": "thread2"
},
{
"name": "checkIn",
"connection": "conn2"
},
{
"name": "waitForThread",
"target": "thread3"
},
{
"name": "checkIn",
"connection": "conn3"
},
{
"name": "waitForThread",
"target": "thread4"
}
],
"events": [
{
"type": "ConnectionCheckOutStarted",
"address": 42
},
{
"type": "ConnectionCheckedOut",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckOutStarted",
"address": 42
},
{
"type": "ConnectionCheckOutStarted",
"address": 42
},
{
"type": "ConnectionCheckOutStarted",
"address": 42
},
{
"type": "ConnectionCheckOutStarted",
"address": 42
},
{
"type": "ConnectionCheckedIn",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckedOut",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckedIn",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckedOut",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckedIn",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckedOut",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckedIn",
"connectionId": 42,
"address": 42
},
{
"type": "ConnectionCheckedOut",
"connectionId": 42,
"address": 42
}
],
"ignore": [
"ConnectionCreated",
"ConnectionReady",
"ConnectionClosed",
"ConnectionPoolReady",
"ConnectionPoolCreated"
]
}

View File

@ -59,4 +59,4 @@
}
}
]
}
}

View File

@ -112,4 +112,4 @@
}
}
]
}
}

View File

@ -1,5 +1,5 @@
{
"description": "client bulkWrite updateOne-sort",
"description": "client bulkWrite replaceOne-sort",
"schemaVersion": "1.4",
"runOnRequirements": [
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 InterruptedAtShutdown error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 InterruptedAtShutdown error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "InterruptedAtShutdown",
"code": 11600
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 InterruptedDueToReplStateChange error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 InterruptedDueToReplStateChange error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "InterruptedDueToReplStateChange",
"code": 11602
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 LegacyNotPrimary error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 LegacyNotPrimary error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "LegacyNotPrimary",
"code": 10058
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 NotPrimaryNoSecondaryOk error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 NotPrimaryNoSecondaryOk error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "NotPrimaryNoSecondaryOk",
"code": 13435
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 NotPrimaryOrSecondary error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 NotPrimaryOrSecondary error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "NotPrimaryOrSecondary",
"code": 13436
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 NotWritablePrimary error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 NotWritablePrimary error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "NotWritablePrimary",
"code": 10107
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 PrimarySteppedDown error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 PrimarySteppedDown error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "PrimarySteppedDown",
"code": 189
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,70 @@
{
"description": "Pre-4.2 ShutdownInProgress error",
"uri": "mongodb://a/?replicaSet=rs",
"phases": [
{
"description": "Primary A is discovered",
"responses": [
[
"a:27017",
{
"ok": 1,
"helloOk": true,
"isWritablePrimary": true,
"hosts": [
"a:27017"
],
"setName": "rs",
"minWireVersion": 0,
"maxWireVersion": 7
}
]
],
"outcome": {
"servers": {
"a:27017": {
"type": "RSPrimary",
"setName": "rs",
"topologyVersion": null,
"pool": {
"generation": 0
}
}
},
"topologyType": "ReplicaSetWithPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
},
{
"description": "Pre-4.2 ShutdownInProgress error marks server Unknown and clears the pool",
"applicationErrors": [
{
"address": "a:27017",
"when": "afterHandshakeCompletes",
"maxWireVersion": 7,
"type": "command",
"response": {
"ok": 0,
"errmsg": "ShutdownInProgress",
"code": 91
}
}
],
"outcome": {
"servers": {
"a:27017": {
"type": "Unknown",
"topologyVersion": null,
"pool": {
"generation": 1
}
}
},
"topologyType": "ReplicaSetNoPrimary",
"logicalSessionTimeoutMinutes": null,
"setName": "rs"
}
}
]
}

View File

@ -0,0 +1,149 @@
{
"description": "pool-clear-application-error",
"schemaVersion": "1.4",
"runOnRequirements": [
{
"minServerVersion": "4.4",
"serverless": "forbid",
"topologies": [
"single",
"replicaset",
"sharded"
]
}
],
"createEntities": [
{
"client": {
"id": "setupClient",
"useMultipleMongoses": false
}
}
],
"initialData": [
{
"collectionName": "find-network-error",
"databaseName": "sdam-tests",
"documents": [
{
"_id": 1
},
{
"_id": 2
}
]
}
],
"tests": [
{
"description": "Pool is cleared before application connection is checked into the pool",
"operations": [
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "setupClient",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"find"
],
"closeConnection": true,
"appName": "findNetworkErrorTest"
}
}
}
},
{
"name": "createEntities",
"object": "testRunner",
"arguments": {
"entities": [
{
"client": {
"id": "client",
"useMultipleMongoses": false,
"observeEvents": [
"poolClearedEvent",
"connectionCheckedInEvent"
],
"uriOptions": {
"retryWrites": false,
"retryReads": false,
"appname": "findNetworkErrorTest"
}
}
},
{
"database": {
"id": "database",
"client": "client",
"databaseName": "sdam-tests"
}
},
{
"collection": {
"id": "collection",
"database": "database",
"collectionName": "find-network-error"
}
}
]
}
},
{
"name": "find",
"object": "collection",
"arguments": {
"filter": {
"_id": 1
}
},
"expectError": {
"isError": true
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"poolClearedEvent": {}
},
"count": 1
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"connectionCheckedInEvent": {}
},
"count": 1
}
}
],
"expectEvents": [
{
"client": "client",
"eventType": "cmap",
"events": [
{
"poolClearedEvent": {}
},
{
"connectionCheckedInEvent": {}
}
]
}
]
}
]
}

View File

@ -0,0 +1,296 @@
{
"description": "pool-clear-on-error-checkout",
"schemaVersion": "1.4",
"runOnRequirements": [
{
"minServerVersion": "4.4",
"serverless": "forbid",
"topologies": [
"single",
"replicaset",
"sharded"
]
}
],
"createEntities": [
{
"client": {
"id": "setupClient",
"useMultipleMongoses": false
}
}
],
"tests": [
{
"description": "Pool is cleared before connection is closed (authentication error)",
"runOnRequirements": [
{
"auth": true
}
],
"operations": [
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "setupClient",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"saslContinue"
],
"appName": "authErrorTest",
"errorCode": 18
}
}
}
},
{
"name": "createEntities",
"object": "testRunner",
"arguments": {
"entities": [
{
"client": {
"id": "client",
"useMultipleMongoses": false,
"observeEvents": [
"connectionCheckOutStartedEvent",
"poolClearedEvent",
"connectionClosedEvent"
],
"uriOptions": {
"retryWrites": false,
"appname": "authErrorTest"
}
}
},
{
"database": {
"id": "database",
"client": "client",
"databaseName": "foo"
}
},
{
"collection": {
"id": "collection",
"database": "database",
"collectionName": "bar"
}
}
]
}
},
{
"name": "insertMany",
"object": "collection",
"arguments": {
"documents": [
{
"_id": 3
},
{
"_id": 4
}
]
},
"expectError": {
"isError": true
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"poolClearedEvent": {}
},
"count": 1
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"connectionClosedEvent": {}
},
"count": 1
}
}
],
"expectEvents": [
{
"client": "client",
"eventType": "cmap",
"events": [
{
"connectionCheckOutStartedEvent": {}
},
{
"poolClearedEvent": {}
},
{
"connectionClosedEvent": {}
}
]
}
]
},
{
"description": "Pool is cleared before connection is closed (handshake error)",
"runOnRequirements": [
{
"topologies": [
"single"
]
}
],
"operations": [
{
"name": "createEntities",
"object": "testRunner",
"arguments": {
"entities": [
{
"client": {
"id": "client",
"useMultipleMongoses": false,
"observeEvents": [
"connectionCheckOutStartedEvent",
"poolClearedEvent",
"connectionClosedEvent",
"topologyDescriptionChangedEvent"
],
"uriOptions": {
"retryWrites": false,
"appname": "authErrorTest",
"minPoolSize": 0,
"serverMonitoringMode": "poll",
"heartbeatFrequencyMS": 1000000
}
}
},
{
"database": {
"id": "database",
"client": "client",
"databaseName": "foo"
}
},
{
"collection": {
"id": "collection",
"database": "database",
"collectionName": "bar"
}
}
]
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {
"previousDescription": {
"type": "Unknown"
},
"newDescription": {
"type": "Single"
}
}
},
"count": 1
}
},
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "setupClient",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"hello",
"isMaster"
],
"appName": "authErrorTest",
"closeConnection": true
}
}
}
},
{
"name": "insertMany",
"object": "collection",
"arguments": {
"documents": [
{
"_id": 3
},
{
"_id": 4
}
]
},
"expectError": {
"isError": true
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"poolClearedEvent": {}
},
"count": 1
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"connectionClosedEvent": {}
},
"count": 1
}
}
],
"expectEvents": [
{
"client": "client",
"eventType": "cmap",
"events": [
{
"connectionCheckOutStartedEvent": {}
},
{
"poolClearedEvent": {}
},
{
"connectionClosedEvent": {}
}
]
}
]
}
]
}

View File

@ -0,0 +1,230 @@
{
"description": "pool-cleared-on-min-pool-size-population-error",
"schemaVersion": "1.4",
"runOnRequirements": [
{
"minServerVersion": "4.4",
"serverless": "forbid",
"topologies": [
"single"
]
}
],
"createEntities": [
{
"client": {
"id": "setupClient",
"useMultipleMongoses": false
}
}
],
"tests": [
{
"description": "Pool is cleared on authentication error during minPoolSize population",
"runOnRequirements": [
{
"auth": true
}
],
"operations": [
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "setupClient",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"saslContinue"
],
"appName": "authErrorTest",
"errorCode": 18
}
}
}
},
{
"name": "createEntities",
"object": "testRunner",
"arguments": {
"entities": [
{
"client": {
"id": "client",
"observeEvents": [
"connectionCreatedEvent",
"poolClearedEvent",
"connectionClosedEvent"
],
"uriOptions": {
"appname": "authErrorTest",
"minPoolSize": 1
}
}
}
]
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"poolClearedEvent": {}
},
"count": 1
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"connectionClosedEvent": {}
},
"count": 1
}
}
],
"expectEvents": [
{
"client": "client",
"eventType": "cmap",
"events": [
{
"connectionCreatedEvent": {}
},
{
"poolClearedEvent": {}
},
{
"connectionClosedEvent": {}
}
]
}
]
},
{
"description": "Pool is cleared on handshake error during minPoolSize population",
"operations": [
{
"name": "createEntities",
"object": "testRunner",
"arguments": {
"entities": [
{
"client": {
"id": "client",
"observeEvents": [
"topologyDescriptionChangedEvent",
"connectionCreatedEvent",
"poolClearedEvent",
"connectionClosedEvent",
"connectionReadyEvent"
],
"uriOptions": {
"appname": "authErrorTest",
"minPoolSize": 5,
"maxConnecting": 1,
"serverMonitoringMode": "poll",
"heartbeatFrequencyMS": 1000000
}
}
}
]
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {
"previousDescription": {
"type": "Unknown"
},
"newDescription": {
"type": "Single"
}
}
},
"count": 1
}
},
{
"name": "failPoint",
"object": "testRunner",
"arguments": {
"client": "setupClient",
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 1
},
"data": {
"failCommands": [
"hello",
"isMaster"
],
"appName": "authErrorTest",
"closeConnection": true
}
}
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"poolClearedEvent": {}
},
"count": 1
}
},
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"connectionClosedEvent": {}
},
"count": 1
}
}
],
"expectEvents": [
{
"client": "client",
"eventType": "cmap",
"events": [
{
"connectionCreatedEvent": {}
},
{
"connectionReadyEvent": {}
},
{
"connectionCreatedEvent": {}
},
{
"poolClearedEvent": {}
},
{
"connectionClosedEvent": {}
}
]
}
]
}
]
}

View File

@ -5,7 +5,8 @@
{
"topologies": [
"single",
"sharded"
"sharded",
"sharded-replicaset"
],
"serverless": "forbid"
}

View File

@ -497,7 +497,7 @@
}
},
"expectError": {
"isError": true
"isClientError": true
}
}
],
@ -650,7 +650,7 @@
}
},
"expectError": {
"isError": true
"isClientError": true
}
}
],

View File

@ -338,7 +338,7 @@
}
},
"expectError": {
"isError": true
"isClientError": true
}
}
]
@ -370,7 +370,7 @@
}
},
"expectError": {
"isError": true
"isClientError": true
}
}
]
@ -402,7 +402,7 @@
}
},
"expectError": {
"isError": true
"isClientError": true
}
}
]
@ -471,7 +471,7 @@
}
},
"expectError": {
"isError": true
"isClientError": true
}
}
]
@ -514,7 +514,7 @@
}
},
"expectError": {
"isError": true
"isClientError": true
}
}
]

View File

@ -290,7 +290,7 @@
"filename": "xyz"
},
"expectError": {
"isError": true
"isClientError": true
}
}
]
@ -306,7 +306,7 @@
"revision": 999
},
"expectError": {
"isError": true
"isClientError": true
}
}
]

179
test/gridfs/rename.json Normal file
View File

@ -0,0 +1,179 @@
{
"description": "gridfs-rename",
"schemaVersion": "1.0",
"createEntities": [
{
"client": {
"id": "client0"
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "gridfs-tests"
}
},
{
"bucket": {
"id": "bucket0",
"database": "database0"
}
},
{
"collection": {
"id": "bucket0_files_collection",
"database": "database0",
"collectionName": "fs.files"
}
},
{
"collection": {
"id": "bucket0_chunks_collection",
"database": "database0",
"collectionName": "fs.chunks"
}
}
],
"initialData": [
{
"collectionName": "fs.files",
"databaseName": "gridfs-tests",
"documents": [
{
"_id": {
"$oid": "000000000000000000000001"
},
"length": 0,
"chunkSize": 4,
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"filename": "filename",
"metadata": {}
},
{
"_id": {
"$oid": "000000000000000000000002"
},
"length": 0,
"chunkSize": 4,
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"filename": "filename",
"metadata": {}
}
]
},
{
"collectionName": "fs.chunks",
"databaseName": "gridfs-tests",
"documents": [
{
"_id": {
"$oid": "000000000000000000000001"
},
"files_id": {
"$oid": "000000000000000000000002"
},
"n": 0,
"data": {
"$binary": {
"base64": "",
"subType": "00"
}
}
}
]
}
],
"tests": [
{
"description": "rename by id",
"operations": [
{
"name": "rename",
"object": "bucket0",
"arguments": {
"id": {
"$oid": "000000000000000000000001"
},
"newFilename": "newfilename"
}
}
],
"outcome": [
{
"collectionName": "fs.files",
"databaseName": "gridfs-tests",
"documents": [
{
"_id": {
"$oid": "000000000000000000000001"
},
"length": 0,
"chunkSize": 4,
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"filename": "newfilename",
"metadata": {}
},
{
"_id": {
"$oid": "000000000000000000000002"
},
"length": 0,
"chunkSize": 4,
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"filename": "filename",
"metadata": {}
}
]
},
{
"collectionName": "fs.chunks",
"databaseName": "gridfs-tests",
"documents": [
{
"_id": {
"$oid": "000000000000000000000001"
},
"files_id": {
"$oid": "000000000000000000000002"
},
"n": 0,
"data": {
"$binary": {
"base64": "",
"subType": "00"
}
}
}
]
}
]
},
{
"description": "rename when file id does not exist",
"operations": [
{
"name": "rename",
"object": "bucket0",
"arguments": {
"id": {
"$oid": "000000000000000000000003"
},
"newFilename": "newfilename"
},
"expectError": {
"isClientError": true
}
}
]
}
]
}

View File

@ -372,6 +372,9 @@
{
"connectionCreatedEvent": {}
},
{
"poolClearedEvent": {}
},
{
"connectionClosedEvent": {
"reason": "error"
@ -381,9 +384,6 @@
"connectionCheckOutFailedEvent": {
"reason": "connectionError"
}
},
{
"poolClearedEvent": {}
}
]
}

View File

@ -11,7 +11,7 @@
"helloOk": true,
"isWritablePrimary": true,
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
]
],

View File

@ -19,7 +19,7 @@
"b:27017"
],
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
]
],

View File

@ -18,7 +18,7 @@
"b:27017"
],
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
]
],

View File

@ -69,7 +69,7 @@
"a:27017"
],
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
],
[

View File

@ -18,7 +18,7 @@
"b:27017"
],
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
]
],

View File

@ -11,7 +11,7 @@
"helloOk": true,
"isWritablePrimary": true,
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
]
],

View File

@ -11,7 +11,7 @@
"helloOk": true,
"isWritablePrimary": true,
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
],
[
@ -21,7 +21,7 @@
"helloOk": true,
"isWritablePrimary": true,
"minWireVersion": 0,
"maxWireVersion": 6
"maxWireVersion": 21
}
]
],

View File

@ -47,29 +47,9 @@
}
}
],
"initialData": [
{
"collectionName": "server-selection",
"databaseName": "logging-tests",
"documents": [
{
"_id": 1,
"x": 11
},
{
"_id": 2,
"x": 22
},
{
"_id": 3,
"x": 33
}
]
}
],
"tests": [
{
"description": "A successful insert operation",
"description": "A successful operation",
"operations": [
{
"name": "waitForEvent",
@ -211,7 +191,7 @@
}
},
{
"level": "debug",
"level": "info",
"component": "serverSelection",
"data": {
"message": "Waiting for suitable server to become available",
@ -250,912 +230,6 @@
]
}
]
},
{
"description": "A successful find operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "findOne",
"object": "collection",
"arguments": {
"filter": {
"x": 1
}
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "find",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "find",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "A successful findAndModify operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "findOneAndReplace",
"object": "collection",
"arguments": {
"filter": {
"x": 1
},
"replacement": {
"x": 11
}
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "findAndModify",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "findAndModify",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "A successful find and getMore operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "find",
"object": "collection",
"arguments": {
"batchSize": 3
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "find",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "find",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "getMore",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "getMore",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "A successful aggregate operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "aggregate",
"object": "collection",
"arguments": {
"pipeline": [
{
"$match": {
"_id": {
"$gt": 1
}
}
}
]
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "aggregate",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "aggregate",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "A successful count operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "countDocuments",
"object": "collection",
"arguments": {
"filter": {}
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "count",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "count",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "A successful distinct operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "distinct",
"object": "collection",
"arguments": {
"fieldName": "x",
"filter": {}
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "distinct",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "distinct",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "Successful collection management operations",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "createCollection",
"object": "database",
"arguments": {
"collection": "foo"
}
},
{
"name": "listCollections",
"object": "database"
},
{
"name": "dropCollection",
"object": "database",
"arguments": {
"collection": "foo"
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "create",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "create",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "listCollections",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "listCollections",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "drop",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "drop",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "Successful index operations",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "createIndex",
"object": "collection",
"arguments": {
"keys": {
"x": 1
},
"name": "x_1"
}
},
{
"name": "listIndexes",
"object": "collection"
},
{
"name": "dropIndex",
"object": "collection",
"arguments": {
"name": "x_1"
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "createIndexes",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "createIndexes",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "listIndexes",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "listIndexes",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "dropIndexes",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "dropIndexes",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "A successful update operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "updateOne",
"object": "collection",
"arguments": {
"filter": {
"x": 1
},
"update": {
"$inc": {
"x": 1
}
}
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "update",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "update",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
},
{
"description": "A successful delete operation",
"operations": [
{
"name": "waitForEvent",
"object": "testRunner",
"arguments": {
"client": "client",
"event": {
"topologyDescriptionChangedEvent": {}
},
"count": 2
}
},
{
"name": "deleteOne",
"object": "collection",
"arguments": {
"filter": {
"x": 1
}
}
}
],
"expectLogMessages": [
{
"client": "client",
"messages": [
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection started",
"selector": {
"$$exists": true
},
"operation": "delete",
"topologyDescription": {
"$$exists": true
}
}
},
{
"level": "debug",
"component": "serverSelection",
"data": {
"message": "Server selection succeeded",
"selector": {
"$$exists": true
},
"operation": "delete",
"topologyDescription": {
"$$exists": true
},
"serverHost": {
"$$type": "string"
},
"serverPort": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
}
]
}

View File

@ -347,7 +347,9 @@
"x": 1
}
},
"new": false,
"new": {
"$$unsetOrMatches": false
},
"lsid": {
"$$sessionLsid": "session0"
},
@ -375,7 +377,9 @@
"x": 1
}
},
"new": false,
"new": {
"$$unsetOrMatches": false
},
"lsid": {
"$$sessionLsid": "session0"
},
@ -627,7 +631,9 @@
"x": 1
}
},
"new": false,
"new": {
"$$unsetOrMatches": false
},
"lsid": {
"$$type": "object"
},
@ -655,7 +661,9 @@
"x": 1
}
},
"new": false,
"new": {
"$$unsetOrMatches": false
},
"lsid": {
"$$type": "object"
},

View File

@ -1,18 +0,0 @@
{
"description": "entity-client-storeEventsAsEntities-minItems",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": []
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,18 +0,0 @@
{
"description": "entity-client-storeEventsAsEntities-type",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": 0
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,26 +0,0 @@
{
"description": "storeEventsAsEntity-additionalProperties",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "client0_events",
"events": [
"CommandStartedEvent"
],
"foo": 0
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,25 +0,0 @@
{
"description": "storeEventsAsEntity-events-enum",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "client0_events",
"events": [
"foo"
]
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,23 +0,0 @@
{
"description": "storeEventsAsEntity-events-minItems",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "client0_events",
"events": []
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,22 +0,0 @@
{
"description": "storeEventsAsEntity-events-required",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "client0_events"
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,23 +0,0 @@
{
"description": "storeEventsAsEntity-events-type",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "client0_events",
"events": 0
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,24 +0,0 @@
{
"description": "storeEventsAsEntity-id-required",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"events": [
"CommandStartedEvent"
]
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,25 +0,0 @@
{
"description": "storeEventsAsEntity-id-type",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": 0,
"events": [
"CommandStartedEvent"
]
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,28 +0,0 @@
{
"description": "entity-client-storeEventsAsEntities-conflict_with_client_id",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "client0",
"events": [
"PoolCreatedEvent",
"PoolReadyEvent",
"PoolClearedEvent",
"PoolClosedEvent"
]
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,43 +0,0 @@
{
"description": "entity-client-storeEventsAsEntities-conflict_within_different_array",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "events",
"events": [
"PoolCreatedEvent",
"PoolReadyEvent",
"PoolClearedEvent",
"PoolClosedEvent"
]
}
]
}
},
{
"client": {
"id": "client1",
"storeEventsAsEntities": [
{
"id": "events",
"events": [
"CommandStartedEvent",
"CommandSucceededEvent",
"CommandFailedEvent"
]
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,36 +0,0 @@
{
"description": "entity-client-storeEventsAsEntities-conflict_within_same_array",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "events",
"events": [
"PoolCreatedEvent",
"PoolReadyEvent",
"PoolClearedEvent",
"PoolClosedEvent"
]
},
{
"id": "events",
"events": [
"CommandStartedEvent",
"CommandSucceededEvent",
"CommandFailedEvent"
]
}
]
}
}
],
"tests": [
{
"description": "foo",
"operations": []
}
]
}

View File

@ -1,67 +0,0 @@
{
"description": "entity-client-storeEventsAsEntities",
"schemaVersion": "1.2",
"createEntities": [
{
"client": {
"id": "client0",
"storeEventsAsEntities": [
{
"id": "client0_events",
"events": [
"CommandStartedEvent",
"CommandSucceededEvent",
"CommandFailedEvent"
]
}
]
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "test"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "coll0"
}
}
],
"initialData": [
{
"collectionName": "coll0",
"databaseName": "test",
"documents": [
{
"_id": 1,
"x": 11
}
]
}
],
"tests": [
{
"description": "storeEventsAsEntities captures events",
"operations": [
{
"name": "find",
"object": "collection0",
"arguments": {
"filter": {}
},
"expectResult": [
{
"_id": 1,
"x": 11
}
]
}
]
}
]
}

View File

@ -0,0 +1,139 @@
{
"tests": [
{
"description": "proxyPort without proxyHost",
"uri": "mongodb://localhost/?proxyPort=1080",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "proxyUsername without proxyHost",
"uri": "mongodb://localhost/?proxyUsername=abc",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "proxyPassword without proxyHost",
"uri": "mongodb://localhost/?proxyPassword=def",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "all other proxy options without proxyHost",
"uri": "mongodb://localhost/?proxyPort=1080&proxyUsername=abc&proxyPassword=def",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "proxyUsername without proxyPassword",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyUsername=abc",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "proxyPassword without proxyUsername",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyPassword=def",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "multiple proxyHost parameters",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyHost=localhost2",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "multiple proxyPort parameters",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyPort=1234&proxyPort=12345",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "multiple proxyUsername parameters",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyUsername=abc&proxyUsername=def&proxyPassword=123",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "multiple proxyPassword parameters",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyUsername=abc&proxyPassword=123&proxyPassword=456",
"valid": false,
"warning": false,
"hosts": null,
"auth": null,
"options": null
},
{
"description": "only host present",
"uri": "mongodb://localhost/?proxyHost=localhost",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "host and default port present",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyPort=1080",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "host and non-default port present",
"uri": "mongodb://localhost/?proxyHost=localhost&proxyPort=12345",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "replicaset, host and non-default port present",
"uri": "mongodb://rs1,rs2,rs3/?proxyHost=localhost&proxyPort=12345",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
},
{
"description": "all options present",
"uri": "mongodb://rs1,rs2,rs3/?proxyHost=localhost&proxyPort=12345&proxyUsername=asdf&proxyPassword=qwerty",
"valid": true,
"warning": false,
"hosts": null,
"auth": null,
"options": {}
}
]
}