Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.loader.mercurial.tests.test_loader::test_clone_with_timeout_returns
Failed

TEST RESULT

Run At
Feb 25 2021, 12:01 PM
Details
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f94ac5f1198> tmp_path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_clone_with_timeout_return0') monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f94ac5f1358> def test_clone_with_timeout_returns(caplog, tmp_path, monkeypatch): log = logging.getLogger("test_clone_with_timeout") def clone_return(source, dest): return (source, dest) monkeypatch.setattr(hglib, "clone", clone_return) > assert HgBundle20Loader.clone_with_timeout( log, "https://www.mercurial-scm.org/repo/hello", tmp_path, 1 ) == ("https://www.mercurial-scm.org/repo/hello", tmp_path) .tox/py3/lib/python3.7/site-packages/swh/loader/mercurial/tests/test_loader.py:352: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ log = <Logger test_clone_with_timeout (WARNING)> origin = 'https://www.mercurial-scm.org/repo/hello' destination = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_clone_with_timeout_return0') timeout = 1 @staticmethod def clone_with_timeout(log, origin, destination, timeout): queue = billiard.Queue() start = time.monotonic() def do_clone(queue, origin, destination): try: result = hglib.clone(source=origin, dest=destination, noupdate=True) except CommandError as e: # the queued object need an empty constructor to be deserialized later queue.put(CommandErrorWrapper(e.err)) except BaseException as e: queue.put(e) else: queue.put(result) process = billiard.Process(target=do_clone, args=(queue, origin, destination)) process.start() while True: try: result = queue.get(timeout=0.1) break except Empty: duration = time.monotonic() - start if timeout and duration > timeout: log.warning( "Timeout cloning `%s` within %s seconds", origin, timeout ) process.terminate() process.join() raise CloneTimeoutError(origin, timeout) continue process.join() if isinstance(result, Exception): > raise result from None E TypeError: clone_return() got an unexpected keyword argument 'noupdate' .tox/py3/lib/python3.7/site-packages/swh/loader/mercurial/loader.py:228: TypeError