hmmm. sometimes the pytest goal gets stuck:
# general
r
hmmm. sometimes the pytest goal gets stuck:
normally this particular test completes within 10 seconds, but i'm not sure what's the problem. At least I need to set timeouts 😉
c
Hi, I’ve no idea as to why that could be, only that setting a
timeout=x
on your tests… yep 😛
Seeing this, maybe it would make sense if there was an arbitrarily large default value for the timeout field, say 900s or so… to break free-running tests like this at least eventually.
r
I just found a typo in the docs 😉
will make a edit proposal
🙌 1
is the root timeout
[pytest].timeout_default
applied to individual tests?
c
Yes:
The default timeout (in seconds) for a test target if the
timeout
field is not set on the target.
https://www.pantsbuild.org/docs/reference-pytest#section-timeout-default
r
how does it interact with
[pytest].timeout_maximum
?
c
I guess the default must be less than the maximum, and if a test target specifies something >maximum it will be capped.
r
for instance, if a test has timeout 100 but timeout_maximum is 50, then is the timeout for the test set 50?
✔️ 1
c
is the root timeout
[pytest].timeout_default
applied to individual tests? (
Oh, I think it applies to an entire test module, not each individual test in a module.
that is, the amount of time allowed for each individual
pytest
run.
r
hm, so the timeout is for not individual test cases but the test modules.
for now it's ok for me
c
There’s a pytest plugin you can use that gives you per test timeouts: https://pypi.org/project/pytest-timeout/ (I’ve not tried it myself though..)
👍 1
r
hmmm
my team members are reporting more cases like this with different test cases
image.png
c
strange..
r
this happens occasionally, not always
if i have more information, i'll let you know
👍 2