Skip to content

Commit 1cfbb47

Browse files
authored
chore: add individual timeout for unit-tests (#1768)
1 parent 50dca4c commit 1cfbb47

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

noxfile.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@
7070
"mock",
7171
"asyncmock",
7272
PYTEST_VERSION,
73-
"pytest-cov",
7473
"pytest-asyncio",
74+
"pytest-cov",
7575
"pytest-mock",
76+
"pytest-timeout",
7677
]
7778
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
7879
UNIT_TEST_DEPENDENCIES: List[str] = []
@@ -228,6 +229,10 @@ def run_unit(session, install_test_extra):
228229
session.run(
229230
"py.test",
230231
"--quiet",
232+
# Any individual test taking longer than 1 mins will be terminated.
233+
"--timeout=60",
234+
# Log 20 slowest tests
235+
"--durations=20",
231236
f"--junitxml=unit_{session.python}_sponge_log.xml",
232237
"--cov=bigframes",
233238
f"--cov={tests_path}",
@@ -355,7 +360,7 @@ def run_system(
355360
# Run py.test against the system tests.
356361
pytest_cmd = [
357362
"py.test",
358-
"--quiet",
363+
"-v",
359364
f"-n={num_workers}",
360365
# Any individual test taking longer than 15 mins will be terminated.
361366
f"--timeout={timeout_seconds}",

0 commit comments

Comments
 (0)