Skip to content

Commit 45efac9

Browse files
committed
increase retries for csot
1 parent c6ce564 commit 45efac9

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

test/asynchronous/unified_format.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,6 @@ async def run_scenario(self, spec, uri=None):
13691369
await self.kill_all_sessions()
13701370

13711371
# Handle flaky tests.
1372-
func = functools.partial(self._run_scenario, spec, uri)
13731372
flaky_tests = [
13741373
# PYTHON-5170
13751374
".*test_discovery_and_monitoring.TestUnifiedInterruptInUsePoolClear.*",
@@ -1379,10 +1378,14 @@ async def run_scenario(self, spec, uri=None):
13791378
]
13801379
for flaky_test in flaky_tests:
13811380
if re.match(flaky_test, self.id()) is not None:
1382-
decorator = flaky(reset_func=self.asyncSetUp, func_name=self.id())
1383-
await decorator(func)()
1381+
func_name = self.id()
1382+
options = dict(reset_func=self.asyncSetUp, func_name=func_name)
1383+
if "csot" in func_name:
1384+
options["max_runs"] = 3
1385+
decorator = flaky(**options)
1386+
await decorator(self._run_scenario)(spec, uri)
13841387
return
1385-
await func()
1388+
await self._run_scenario(spec, uri)
13861389

13871390
async def _run_scenario(self, spec, uri=None):
13881391
# maybe skip test manually

test/unified_format.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,6 @@ def run_scenario(self, spec, uri=None):
13561356
self.kill_all_sessions()
13571357

13581358
# Handle flaky tests.
1359-
func = functools.partial(self._run_scenario, spec, uri)
13601359
flaky_tests = [
13611360
# PYTHON-5170
13621361
".*test_discovery_and_monitoring.TestUnifiedInterruptInUsePoolClear.*",
@@ -1366,10 +1365,14 @@ def run_scenario(self, spec, uri=None):
13661365
]
13671366
for flaky_test in flaky_tests:
13681367
if re.match(flaky_test, self.id()) is not None:
1369-
decorator = flaky(reset_func=self.setUp, func_name=self.id())
1370-
decorator(func)()
1368+
func_name = self.id()
1369+
options = dict(reset_func=self.setUp, func_name=func_name)
1370+
if "csot" in func_name:
1371+
options["max_runs"] = 3
1372+
decorator = flaky(**options)
1373+
decorator(self._run_scenario)(spec, uri)
13711374
return
1372-
func()
1375+
self._run_scenario(spec, uri)
13731376

13741377
def _run_scenario(self, spec, uri=None):
13751378
# maybe skip test manually

0 commit comments

Comments
 (0)