https://pantsbuild.org/ logo
#general
Title
# general
r

rhythmic-morning-87313

06/10/2022, 6:37 AM
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

curved-television-6568

06/10/2022, 6:39 AM
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

rhythmic-morning-87313

06/10/2022, 6:45 AM
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

curved-television-6568

06/10/2022, 6:47 AM
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

rhythmic-morning-87313

06/10/2022, 6:47 AM
how does it interact with
[pytest].timeout_maximum
?
c

curved-television-6568

06/10/2022, 6:47 AM
I guess the default must be less than the maximum, and if a test target specifies something >maximum it will be capped.
r

rhythmic-morning-87313

06/10/2022, 6:48 AM
for instance, if a test has timeout 100 but timeout_maximum is 50, then is the timeout for the test set 50?
✔️ 1
c

curved-television-6568

06/10/2022, 6:48 AM
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

rhythmic-morning-87313

06/10/2022, 6:50 AM
hm, so the timeout is for not individual test cases but the test modules.
for now it's ok for me
c

curved-television-6568

06/10/2022, 6:51 AM
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

rhythmic-morning-87313

06/10/2022, 6:57 AM
hmmm
my team members are reporting more cases like this with different test cases
image.png
c

curved-television-6568

06/10/2022, 6:58 AM
strange..
r

rhythmic-morning-87313

06/10/2022, 7:01 AM
this happens occasionally, not always
if i have more information, i'll let you know
👍 2
3 Views