tox expectedly failing
With something like:
```
$ pytest -x -s swh/ -k test_clone_timeout --pdb
============================================================================================================= test session starts =============================================================================================================
platform linux -- Python 3.7.3, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /home/tony/work/inria/repo/swh/swh-environment/swh-loader-mercurial, configfile: pytest.ini
plugins: xdist-1.32.0, celery-4.4.6, testinfra-5.2.1, postgresql-2.4.0, django-test-migrations-1.1.0, forked-1.2.0, asyncio-0.12.0, requests-mock-1.8.0, mock-3.1.1, dash-1.13.1, cov-2.11.1, django-3.9.0, flask-1.0.0, hypothesis-6.8.9, redis-2.0.0, kafka-0.4.0, swh.core-0.14.3, swh.journal-0.8.0
collected 54 items / 53 deselected / 1 selected
swh/loader/mercurial/tests/test_hgutil.py 2021-07-28 14:59:25.895169+00:00 start
2021-07-28 14:59:25.899062+00:00 start
2021-07-28 14:59:25.904826+00:00 clone start
(false clone) 2021-07-28 14:59:25.905633+00:00 Sleep for 1.0 seconds.
2021-07-28 14:59:26.003093+00:00 joined
2021-07-28 14:59:26.003335+00:00 process still alive
2021-07-28 14:59:26.003485+00:00 sleep 0.1 second
2021-07-28 14:59:26.103916+00:00 sleep 0.1 second
2021-07-28 14:59:26.204577+00:00 sleep 0.1 second
2021-07-28 14:59:26.304961+00:00 sleep 0.1 second
2021-07-28 14:59:26.405368+00:00 sleep 0.1 second
2021-07-28 14:59:26.505756+00:00 sleep 0.1 second
2021-07-28 14:59:26.606223+00:00 sleep 0.1 second
2021-07-28 14:59:26.706600+00:00 sleep 0.1 second
2021-07-28 14:59:26.807089+00:00 sleep 0.1 second
(false clone) 2021-07-28 14:59:26.906694+00:00 Slept but this should never get printed!
2021-07-28 14:59:26.906909+00:00 clone end
2021-07-28 14:59:26.907555+00:00 sleep 0.1 second
2021-07-28 14:59:27.008067+00:00 process not alive, break
F
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fe3a9ac2550>
def test_clone_timeout(monkeypatch):
src = "https://www.mercurial-scm.org/repo/hello"
dest = "/dev/null"
timeout = 0.1
sleepy_time = 10 * timeout
assert sleepy_time > timeout
def clone(*args, sleepy_time=sleepy_time, **kwargs):
# ignore SIGTERM to force sigkill
signal.signal(signal.SIGTERM, lambda signum, frame: None)
print(f"(false clone) {utcnow()} Sleep for {sleepy_time} seconds.")
time.sleep(sleepy_time) # we make sure we exceed the timeout
print(f"(false clone) {utcnow()} Slept but this should never get printed!")
monkeypatch.setattr(hg, "clone", clone)
with pytest.raises(hgutil.CloneTimeout) as e:
hgutil.clone(src, dest, timeout)
killed = True
> assert e.value.args == (src, timeout, killed)
E AssertionError: assert ('https://www...', 0.1, False) == ('https://www...o', 0.1, True)
E At index 2 diff: False != True
E Use -v to get the full diff
swh/loader/mercurial/tests/test_hgutil.py:36: AssertionError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[12] > /home/tony/work/inria/repo/swh/swh-environment/swh-loader-mercurial/swh/loader/mercurial/tests/test_hgutil.py(36)test_clone_timeout()
-> assert e.value.args == (src, timeout, killed)
6 frames hidden (try 'help hidden_frames')
```