-
Notifications
You must be signed in to change notification settings - Fork 891
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5df3c4
commit 89fd823
Showing
6 changed files
with
371 additions
and
0 deletions.
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
testdata/connection-monitoring-and-pooling/pool-clear-interrupt-immediately.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"version": 1, | ||
"style": "unit", | ||
"description": "Connections MUST be interrupted as soon as possible (interruptInUseConnections=true)", | ||
"poolOptions": { | ||
"backgroundThreadIntervalMS": 10000 | ||
}, | ||
"operations": [ | ||
{ | ||
"name": "ready" | ||
}, | ||
{ | ||
"name": "checkOut" | ||
}, | ||
{ | ||
"name": "checkOut", | ||
"label": "conn" | ||
}, | ||
{ | ||
"name": "clear", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionPoolCleared", | ||
"count": 1, | ||
"timeout": 1000 | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionClosed", | ||
"count": 2, | ||
"timeout": 1000 | ||
}, | ||
{ | ||
"name": "close" | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"type": "ConnectionCheckedOut", | ||
"connectionId": 1, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionCheckedOut", | ||
"connectionId": 2, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionPoolCleared", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"reason": "stale", | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"reason": "stale", | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionPoolClosed", | ||
"address": 42 | ||
} | ||
], | ||
"ignore": [ | ||
"ConnectionCreated", | ||
"ConnectionPoolReady", | ||
"ConnectionReady", | ||
"ConnectionCheckOutStarted", | ||
"ConnectionPoolCreated", | ||
"ConnectionCheckedIn" | ||
] | ||
} |
46 changes: 46 additions & 0 deletions
46
testdata/connection-monitoring-and-pooling/pool-clear-interrupt-immediately.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: 1 | ||
style: unit | ||
description: Connections MUST be interrupted as soon as possible (interruptInUseConnections=true) | ||
poolOptions: | ||
# ensure it's not involved by default | ||
backgroundThreadIntervalMS: 10000 | ||
operations: | ||
- name: ready | ||
- name: checkOut | ||
- name: checkOut | ||
label: conn | ||
- name: clear | ||
interruptInUseConnections: true | ||
- name: waitForEvent | ||
event: ConnectionPoolCleared | ||
count: 1 | ||
timeout: 1000 | ||
- name: waitForEvent | ||
event: ConnectionClosed | ||
count: 2 | ||
timeout: 1000 | ||
- name: close | ||
events: | ||
- type: ConnectionCheckedOut | ||
connectionId: 1 | ||
address: 42 | ||
- type: ConnectionCheckedOut | ||
connectionId: 2 | ||
address: 42 | ||
- type: ConnectionPoolCleared | ||
interruptInUseConnections: true | ||
- type: ConnectionClosed | ||
reason: stale | ||
address: 42 | ||
- type: ConnectionClosed | ||
reason: stale | ||
address: 42 | ||
- type: ConnectionPoolClosed | ||
address: 42 | ||
ignore: | ||
- ConnectionCreated | ||
- ConnectionPoolReady | ||
- ConnectionReady | ||
- ConnectionCheckOutStarted | ||
- ConnectionPoolCreated | ||
- ConnectionCheckedIn |
77 changes: 77 additions & 0 deletions
77
testdata/connection-monitoring-and-pooling/pool-clear-interrupting-pending-connections.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"version": 1, | ||
"style": "integration", | ||
"description": "clear with interruptInUseConnections = true closes pending connections", | ||
"runOn": [ | ||
{ | ||
"minServerVersion": "4.9.0" | ||
} | ||
], | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": "alwaysOn", | ||
"data": { | ||
"failCommands": [ | ||
"isMaster", | ||
"hello" | ||
], | ||
"closeConnection": false, | ||
"blockConnection": true, | ||
"blockTimeMS": 1000 | ||
} | ||
}, | ||
"poolOptions": { | ||
"minPoolSize": 0 | ||
}, | ||
"operations": [ | ||
{ | ||
"name": "ready" | ||
}, | ||
{ | ||
"name": "start", | ||
"target": "thread1" | ||
}, | ||
{ | ||
"name": "checkOut", | ||
"thread": "thread1" | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionCreated", | ||
"count": 1 | ||
}, | ||
{ | ||
"name": "clear", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionCheckOutFailed", | ||
"count": 1 | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"type": "ConnectionCheckOutStarted" | ||
}, | ||
{ | ||
"type": "ConnectionCreated" | ||
}, | ||
{ | ||
"type": "ConnectionPoolCleared", | ||
"interruptInUseConnections": true | ||
}, | ||
{ | ||
"type": "ConnectionClosed" | ||
}, | ||
{ | ||
"type": "ConnectionCheckOutFailed" | ||
} | ||
], | ||
"ignore": [ | ||
"ConnectionCheckedIn", | ||
"ConnectionCheckedOut", | ||
"ConnectionPoolCreated", | ||
"ConnectionPoolReady" | ||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
testdata/connection-monitoring-and-pooling/pool-clear-interrupting-pending-connections.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: 1 | ||
style: integration | ||
description: clear with interruptInUseConnections = true closes pending connections | ||
runOn: | ||
- | ||
minServerVersion: "4.9.0" | ||
failPoint: | ||
configureFailPoint: failCommand | ||
mode: "alwaysOn" | ||
data: | ||
failCommands: ["isMaster","hello"] | ||
closeConnection: false | ||
blockConnection: true | ||
blockTimeMS: 1000 | ||
poolOptions: | ||
minPoolSize: 0 | ||
operations: | ||
- name: ready | ||
- name: start | ||
target: thread1 | ||
- name: checkOut | ||
thread: thread1 | ||
- name: waitForEvent | ||
event: ConnectionCreated | ||
count: 1 | ||
- name: clear | ||
interruptInUseConnections: true | ||
- name: waitForEvent | ||
event: ConnectionCheckOutFailed | ||
count: 1 | ||
events: | ||
- type: ConnectionCheckOutStarted | ||
- type: ConnectionCreated | ||
- type: ConnectionPoolCleared | ||
interruptInUseConnections: true | ||
- type: ConnectionClosed | ||
- type: ConnectionCheckOutFailed | ||
ignore: | ||
- ConnectionCheckedIn | ||
- ConnectionCheckedOut | ||
- ConnectionPoolCreated | ||
- ConnectionPoolReady |
81 changes: 81 additions & 0 deletions
81
...ction-monitoring-and-pooling/pool-clear-schedule-run-interruptInUseConnections-false.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"version": 1, | ||
"style": "unit", | ||
"description": "Pool clear SHOULD schedule the next background thread run immediately (interruptInUseConnections = false)", | ||
"poolOptions": { | ||
"backgroundThreadIntervalMS": 10000 | ||
}, | ||
"operations": [ | ||
{ | ||
"name": "ready" | ||
}, | ||
{ | ||
"name": "checkOut" | ||
}, | ||
{ | ||
"name": "checkOut", | ||
"label": "conn" | ||
}, | ||
{ | ||
"name": "checkIn", | ||
"connection": "conn" | ||
}, | ||
{ | ||
"name": "clear", | ||
"interruptInUseConnections": false | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionPoolCleared", | ||
"count": 1, | ||
"timeout": 1000 | ||
}, | ||
{ | ||
"name": "waitForEvent", | ||
"event": "ConnectionClosed", | ||
"count": 1, | ||
"timeout": 1000 | ||
}, | ||
{ | ||
"name": "close" | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"type": "ConnectionCheckedOut", | ||
"connectionId": 1, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionCheckedOut", | ||
"connectionId": 2, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionCheckedIn", | ||
"connectionId": 2, | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionPoolCleared", | ||
"interruptInUseConnections": false | ||
}, | ||
{ | ||
"type": "ConnectionClosed", | ||
"connectionId": 2, | ||
"reason": "stale", | ||
"address": 42 | ||
}, | ||
{ | ||
"type": "ConnectionPoolClosed", | ||
"address": 42 | ||
} | ||
], | ||
"ignore": [ | ||
"ConnectionCreated", | ||
"ConnectionPoolReady", | ||
"ConnectionReady", | ||
"ConnectionCheckOutStarted", | ||
"ConnectionPoolCreated" | ||
] | ||
} |
48 changes: 48 additions & 0 deletions
48
...ection-monitoring-and-pooling/pool-clear-schedule-run-interruptInUseConnections-false.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: 1 | ||
style: unit | ||
description: Pool clear SHOULD schedule the next background thread run immediately (interruptInUseConnections = false) | ||
poolOptions: | ||
# ensure it's not involved by default | ||
backgroundThreadIntervalMS: 10000 | ||
operations: | ||
- name: ready | ||
- name: checkOut | ||
- name: checkOut | ||
label: conn | ||
- name: checkIn | ||
connection: conn | ||
- name: clear | ||
interruptInUseConnections: false | ||
- name: waitForEvent | ||
event: ConnectionPoolCleared | ||
count: 1 | ||
timeout: 1000 | ||
- name: waitForEvent | ||
event: ConnectionClosed | ||
count: 1 | ||
timeout: 1000 | ||
- name: close | ||
events: | ||
- type: ConnectionCheckedOut | ||
connectionId: 1 | ||
address: 42 | ||
- type: ConnectionCheckedOut | ||
connectionId: 2 | ||
address: 42 | ||
- type: ConnectionCheckedIn | ||
connectionId: 2 | ||
address: 42 | ||
- type: ConnectionPoolCleared | ||
interruptInUseConnections: false | ||
- type: ConnectionClosed | ||
connectionId: 2 | ||
reason: stale | ||
address: 42 | ||
- type: ConnectionPoolClosed | ||
address: 42 | ||
ignore: | ||
- ConnectionCreated | ||
- ConnectionPoolReady | ||
- ConnectionReady | ||
- ConnectionCheckOutStarted | ||
- ConnectionPoolCreated |