Skip to content

Commit

Permalink
wip PHPLIB-1228: Run legacy transaction tests on LB topologies
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Sep 27, 2023
1 parent bb63143 commit 340a84d
Show file tree
Hide file tree
Showing 33 changed files with 910 additions and 696 deletions.
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/abort.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/bulk.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/causal-consistency.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/commit.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/count.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/create-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"minServerVersion": "4.3.4",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/create-index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"minServerVersion": "4.3.4",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/delete.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
160 changes: 160 additions & 0 deletions tests/SpecTests/transactions/error-labels-blockConnection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"runOn": [
{
"minServerVersion": "4.2",
"topology": [
"replicaset",
"sharded",
"load-balanced"
]
}
],
"database_name": "transaction-tests",
"collection_name": "test",
"data": [],
"tests": [
{
"description": "add RetryableWriteError and UnknownTransactionCommitResult labels to connection errors",
"clientOptions": {
"socketTimeoutMS": 100
},
"failPoint": {
"configureFailPoint": "failCommand",
"mode": {
"times": 2
},
"data": {
"failCommands": [
"commitTransaction"
],
"blockConnection": true,
"blockTimeMS": 150
}
},
"operations": [
{
"name": "startTransaction",
"object": "session0"
},
{
"name": "insertOne",
"object": "collection",
"arguments": {
"session": "session0",
"document": {
"_id": 1
}
},
"result": {
"insertedId": 1
}
},
{
"name": "commitTransaction",
"object": "session0",
"result": {
"errorLabelsContain": [
"RetryableWriteError",
"UnknownTransactionCommitResult"
],
"errorLabelsOmit": [
"TransientTransactionError"
]
}
},
{
"name": "commitTransaction",
"object": "session0"
}
],
"expectations": [
{
"command_started_event": {
"command": {
"insert": "test",
"documents": [
{
"_id": 1
}
],
"ordered": true,
"readConcern": null,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": true,
"autocommit": false,
"writeConcern": null
},
"command_name": "insert",
"database_name": "transaction-tests"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": null
},
"command_name": "commitTransaction",
"database_name": "admin"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": {
"w": "majority",
"wtimeout": 10000
}
},
"command_name": "commitTransaction",
"database_name": "admin"
}
},
{
"command_started_event": {
"command": {
"commitTransaction": 1,
"lsid": "session0",
"txnNumber": {
"$numberLong": "1"
},
"startTransaction": null,
"autocommit": false,
"writeConcern": {
"w": "majority",
"wtimeout": 10000
}
},
"command_name": "commitTransaction",
"database_name": "admin"
}
}
],
"outcome": {
"collection": {
"data": [
{
"_id": 1
}
]
}
}
}
]
}
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/error-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
],
"serverless": "forbid"
}
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/errors-client.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/findOneAndDelete.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/findOneAndReplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/findOneAndUpdate.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/insert.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/isolation.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/mongos-pin-auto.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
],
"serverless": "forbid"
}
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/mongos-recovery-token.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
],
"serverless": "forbid"
}
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/pin-mongos.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
],
"serverless": "forbid"
}
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/read-concern.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/read-pref.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion tests/SpecTests/transactions/reads.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
{
"minServerVersion": "4.1.8",
"topology": [
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"minServerVersion": "4.3.1",
"topology": [
"replicaset",
"sharded"
"sharded",
"load-balanced"
]
}
],
Expand Down
Loading

0 comments on commit 340a84d

Please sign in to comment.