mongo-python-driver/test/transactions/isolation.json
Shane Harvey ca6a34f51d PYTHON-1508 SPEC-1097 Resync transaction tests
Database.command without a read_preference defaults to the
transaction's or Primary if the session is not in a transaction
Add runCommand transaction tests.
Update count tests.
2018-06-01 16:29:11 -07:00

212 lines
4.1 KiB
JSON

{
"database_name": "transaction-tests",
"collection_name": "test",
"data": [],
"tests": [
{
"description": "one transaction",
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "find",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 1
}
},
"result": [
{
"_id": 1
}
]
},
{
"name": "find",
"object": "collection",
"arguments": {
"session": "session1",
"filter": {
"_id": 1
}
},
"result": []
},
{
"name": "find",
"object": "collection",
"arguments": {
"filter": {
"_id": 1
}
},
"result": []
},
{
"name": "commitTransaction",
"object": "session0"
},
{
"name": "find",
"object": "collection",
"arguments": {
"session": "session1",
"filter": {
"_id": 1
}
},
"result": [
{
"_id": 1
}
]
},
{
"name": "find",
"object": "collection",
"arguments": {
"filter": {
"_id": 1
}
},
"result": [
{
"_id": 1
}
]
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1
}
]
}
}
},
{
"description": "two transactions",
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "startTransaction",
"object": "session1"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "find",
"object": "collection",
"arguments": {
"session": "session0",
"filter": {
"_id": 1
}
},
"result": [
{
"_id": 1
}
]
},
{
"name": "find",
"object": "collection",
"arguments": {
"session": "session1",
"filter": {
"_id": 1
}
},
"result": []
},
{
"name": "find",
"object": "collection",
"arguments": {
"filter": {
"_id": 1
}
},
"result": []
},
{
"name": "commitTransaction",
"object": "session0"
},
{
"name": "find",
"object": "collection",
"arguments": {
"session": "session1",
"filter": {
"_id": 1
}
},
"result": []
},
{
"name": "find",
"object": "collection",
"arguments": {
"filter": {
"_id": 1
}
},
"result": [
{
"_id": 1
}
]
},
{
"name": "commitTransaction",
"object": "session1"
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1
}
]
}
}
}
]
}