Skip to content

Commit 5fd113e

Browse files
committed
Apply the timeout separately to each pylsp test
1 parent fa5d46a commit 5fd113e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

testsuite/drivers/pylsp.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,16 @@ def run(self) -> None:
118118
if r.status != 0:
119119
raise TestAbortWithFailure("non-zero status code")
120120
else:
121+
# Usually we specify a timeout here, however a test file may
122+
# contain multiple tests. So instead we apply a timeout to each
123+
# test in async_wrapper()
121124
p: ProcessResult = self.shell(
122125
cmd,
123126
# Start the test process directly in the test work dir. This way
124127
# tests can simply assume that the current dir is the test work dir.
125128
cwd=str(wd),
126129
env=env,
127130
ignore_environ=False,
128-
timeout=15, # seconds
129131
stdin=None,
130132
)
131133

@@ -647,8 +649,9 @@ async def async_wrapper(
647649

648650
LOG.info("Running test function: %s", func.__name__)
649651

650-
# Run the test
651-
await func(client)
652+
# Run the test with a timeout
653+
async with asyncio.timeout(15): # seconds
654+
await func(client)
652655

653656
if assert_no_lsp_errors:
654657
# Assert the absence of Error LSP log messages

0 commit comments

Comments
 (0)