Comments (1)
I tried reproducing this as such:
[sc]flub@powell ~
> pew mktmpenv -p python3 1s 32ms
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/flub/.local/share/virtualenvs/9dade4d24cea1398/bin/python3
Also creating executable in /home/flub/.local/share/virtualenvs/9dade4d24cea1398/bin/python
Please make sure you remove any previous custom paths from your /home/flub/.pydistutils.cfg file.
Installing setuptools, pip, wheel...
done.
This is a temporary environment. It will be deleted when you exit
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.
9dade4d24cea1398 [sc]flub@powell /t/s/retrying
> cat >test.py 4ms
import pytest
from retrying import retry
@retry(
stop_max_delay=15*1000,
wait_fixed=1000
)
def _loop_until_condition():
assert 1 == 0
class TestSample:
def test_something(self):
_loop_until_condition()
9dade4d24cea1398 [sc]flub@powell /t/s/retrying
> pip install pytest pytest-timeout retrying 3s 100ms
Collecting pytest
Using cached pytest-5.3.5-py3-none-any.whl (235 kB)
Collecting pytest-timeout
Using cached pytest_timeout-1.3.4-py2.py3-none-any.whl (10 kB)
Collecting retrying
Downloading retrying-1.3.3.tar.gz (10 kB)
Collecting py>=1.5.0
Using cached py-1.8.1-py2.py3-none-any.whl (83 kB)
Collecting pluggy<1.0,>=0.12
Using cached pluggy-0.13.1-py2.py3-none-any.whl (18 kB)
Collecting packaging
Using cached packaging-20.1-py2.py3-none-any.whl (36 kB)
Collecting importlib-metadata>=0.12; python_version < "3.8"
Downloading importlib_metadata-1.5.0-py2.py3-none-any.whl (30 kB)
Collecting more-itertools>=4.0.0
Using cached more_itertools-8.2.0-py3-none-any.whl (43 kB)
Collecting attrs>=17.4.0
Using cached attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Collecting wcwidth
Using cached wcwidth-0.1.8-py2.py3-none-any.whl (17 kB)
Collecting six>=1.7.0
Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Collecting pyparsing>=2.0.2
Using cached pyparsing-2.4.6-py2.py3-none-any.whl (67 kB)
Collecting zipp>=0.5
Downloading zipp-3.0.0-py3-none-any.whl (4.8 kB)
Building wheels for collected packages: retrying
Building wheel for retrying (setup.py) ... done
Created wheel for retrying: filename=retrying-1.3.3-py3-none-any.whl size=11430 sha256=13cff71c89cbd2934ef4dd52aa3a7aae590ad4873ef990daab549838b4ccdbf4
Stored in directory: /home/flub/.cache/pip/wheels/f9/8d/8d/f6af3f7f9eea3553bc2fe6d53e4b287dad18b06a861ac56ddf
Successfully built retrying
Installing collected packages: py, zipp, importlib-metadata, pluggy, six, pyparsing, packaging, more-itertools, attrs, wcwidth, pytest, pytest-timeout, retrying
Successfully installed attrs-19.3.0 importlib-metadata-1.5.0 more-itertools-8.2.0 packaging-20.1 pluggy-0.13.1 py-1.8.1 pyparsing-2.4.6 pytest-5.3.5 pytest-timeout-1.3.4 retrying-1.3.3 six-1.14.0 wcwidth-0.1.8 zipp-3.0.0
9dade4d24cea1398 [sc]flub@powell /t/s/retrying
> pytest --timeout=1 test.py 3s 901ms
================================================================= test session starts ==================================================================
platform linux -- Python 3.7.6, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /tmp/sandbox/retrying
plugins: timeout-1.3.4
timeout: 1.0s
timeout method: signal
timeout func_only: False
collected 1 item
test.py F [100%]
======================================================================= FAILURES =======================================================================
______________________________________________________________ TestSample.test_something _______________________________________________________________
self = <test.TestSample object at 0x7fbe3ca30750>
def test_something(self):
> _loop_until_condition()
test.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/flub/.local/share/virtualenvs/9dade4d24cea1398/lib/python3.7/site-packages/retrying.py:49: in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <retrying.Retrying object at 0x7fbe3ca30690>, fn = <function _loop_until_condition at 0x7fbe3ca2a830>, args = (), kwargs = {}
start_time = 1583189367445, attempt_number = 1
attempt = Attempts: 1, Error:
File "/home/flub/.local/share/virtualenvs/9dade4d24cea1398/lib/python3.7/site-packages/retrying....gs), attempt_number, False)
File "/tmp/sandbox/retrying/test.py", line 9, in _loop_until_condition
assert 1 == 0
tb = (<class 'AssertionError'>, AssertionError('assert 1 == 0'), <traceback object at 0x7fbe3c998690>), delay_since_first_attempt_ms = 0, sleep = 1000
def call(self, fn, *args, **kwargs):
start_time = int(round(time.time() * 1000))
attempt_number = 1
while True:
try:
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
except:
tb = sys.exc_info()
attempt = Attempt(tb, attempt_number, True)
if not self.should_reject(attempt):
return attempt.get(self._wrap_exception)
delay_since_first_attempt_ms = int(round(time.time() * 1000)) - start_time
if self.stop(attempt_number, delay_since_first_attempt_ms):
if not self._wrap_exception and attempt.has_exception:
# get() on an attempt with an exception should cause it to be raised, but raise just in case
raise attempt.get()
else:
raise RetryError(attempt)
else:
sleep = self.wait(attempt_number, delay_since_first_attempt_ms)
if self._wait_jitter_max:
jitter = random.random() * self._wait_jitter_max
sleep = sleep + max(0, jitter)
> time.sleep(sleep / 1000.0)
E Failed: Timeout >1.0s
/home/flub/.local/share/virtualenvs/9dade4d24cea1398/lib/python3.7/site-packages/retrying.py:220: Failed
================================================================== 1 failed in 1.04s ===================================================================
(1) 9dade4d24cea1398 [sc]flub@powell /t/s/retrying
>
So seems like this is working just fine? Perhaps something else in your setup is interfering.
from pytest-timeout.
Related Issues (20)
- Timeout with xdist causes worker crash and reported as error in html HOT 5
- gracefully exit the program HOT 1
- Pytest-timeout is not activated in debugging mode HOT 2
- Status of support for timeouts in native code HOT 2
- `timeout_func_only = true` config does not work HOT 7
- Flask pytest client.post request - timeout error
- is_debugging does not work in VS Code HOT 1
- New Version HOT 9
- how can I get rid of the stack-trace HOT 4
- Question/feature request: way to pause timing HOT 5
- Pytest times out in debug mode with Pycharm 2023.2.1 HOT 1
- pytest timeout in pytest.ini is not working HOT 4
- Measure CPU time instead of wallclock time HOT 4
- Bad and misleading test HOT 2
- subprocess not killed when timeout fires HOT 4
- INTERNALERROR with pytest_configure HOT 2
- feature request: add suite timeout HOT 6
- default branch: master -> main HOT 2
- [QUESTION] When can we expect a release? HOT 3
- [question] hook for executing small bit of code before timeout fires HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-timeout.