|
32 | 32 | async_wait_until, |
33 | 33 | camel_to_snake, |
34 | 34 | ) |
| 35 | +from test.version import Version |
35 | 36 |
|
36 | 37 | from bson.objectid import ObjectId |
37 | 38 | from bson.son import SON |
@@ -145,6 +146,10 @@ async def ready(self, op): |
145 | 146 | """Run the 'ready' operation.""" |
146 | 147 | await self.pool.ready() |
147 | 148 |
|
| 149 | + async def backoff(self, op): |
| 150 | + """Run the 'backoff' operation.""" |
| 151 | + await self.pool.backoff() |
| 152 | + |
148 | 153 | async def clear(self, op): |
149 | 154 | """Run the 'clear' operation.""" |
150 | 155 | if "interruptInUseConnections" in op: |
@@ -224,6 +229,20 @@ async def run_scenario(self, scenario_def, test): |
224 | 229 | self.listener = CMAPListener() |
225 | 230 | self._ops: list = [] |
226 | 231 |
|
| 232 | + if "runOn" in test: |
| 233 | + for run_reqs in test["runOn"]: |
| 234 | + if "minServerVersion" in run_reqs: |
| 235 | + other_version = Version.from_string(run_reqs["minServerVersion"]) |
| 236 | + if async_client_context.version < other_version: |
| 237 | + self.skipTest(f"Server version must be at least {other_version}") |
| 238 | + if "maxServerVersion" in run_reqs: |
| 239 | + other_version = Version.from_string(run_reqs["maxServerVersion"]) |
| 240 | + if async_client_context.version > other_version: |
| 241 | + self.skipTest(f"Server version must be at most {other_version}") |
| 242 | + if "poolBackoff" in run_reqs: |
| 243 | + if run_reqs["poolBackoff"] is False: |
| 244 | + self.skipTest("We support poolBackoff") |
| 245 | + |
227 | 246 | # Configure the fail point before creating the client. |
228 | 247 | if "failPoint" in test: |
229 | 248 | fp = test["failPoint"] |
|
0 commit comments