Closed AndreiPashkin closed 8 years ago
There's one code style issue and one "weird" failure:
=================================== FAILURES ===================================
_______________________________ test_no_overlap ________________________________
tests/test_redis_lock.py:201: in test_no_overlap
wait_for_strings(proc.read, TIMEOUT, 'Getting %r ...' % name)
.tox/2.7-1.6-nocover/lib/python2.7/site-packages/process_tests.py:239: in wait_for_strings
seconds, check_strings
E AssertionError: Waited 10.00secs but ["Getting 'lock:foobar' ..."] did not appear in output in the given order !
----------------------------- Captured stdout call -----------------------------
*********** OUTPUT ***********
******************************
============================ pytest-warning summary ============================
WI1 /home/travis/build/ionelmc/python-redis-lock/.tox/2.7-1.6-nocover/lib/python2.7/site-packages/pytest_capturelog.py:171 'pytest_runtest_makereport' hook uses deprecated __multicall__ argument
WC1 /home/travis/build/ionelmc/python-redis-lock/tests/test_redis_lock.py cannot collect test class 'TestProcess' because it has a __init__ constructor
=========================== short test summary info ============================
FAIL tests/test_redis_lock.py::test_no_overlap
SKIP [13] /home/travis/build/ionelmc/python-redis-lock/.tox/2.7-1.6-nocover/lib/python2.7/site-packages/_pytest/doctest.py:165: all tests skipped by +SKIP option
===== 1 failed, 25 passed, 13 skipped, 2 pytest-warnings in 70.41 seconds ======
ERROR: InvocationError: '/home/travis/build/ionelmc/python-redis-lock/.tox/2.7-1.6-nocover/bin/py.test -vv --ignore=src'
___________________________________ summary ____________________________________
ERROR: 2.7-1.6-nocover: commands failed
I think it's just one of those failures caused by Travis being incredibly slow.
Wait a sec.
"Weird" error again, in different venv.
I think I may have written some bad code in that test ...
Do you see anything wrong with this https://github.com/ionelmc/python-redis-lock/blob/master/tests/helper.py#L47-L56 ?
Refactored test_no_overlap
, check it.
Yeah! It works!
I've raised the timeouts in the old test_no_overlap and it seems to always pass now. I've rebased your code on top of that and it also pass.
https://github.com/ionelmc/python-redis-lock/commits/improve-test-no-overlap https://travis-ci.org/ionelmc/python-redis-lock/builds/93839233
That branch has the old test and your new test. I'm a bit weary of removing test code :grimacing:
Let me know if you're fine with having that in master.
Included your code and refactored my version to not use notify_all
and also be faster.
BTW, what software did you used to make the diagram?
It's just google docs: https://docs.google.com/drawings/d/1XZWt0HKdzilDeVp8xbml-lLaXngP3JTVG7f-yE8W8bo
I'm gonna update that in a bit.
Alright, thank you for the changes!
:shipit::+1:
Fixes #26