args = ('forward', 'snp:*,rev:*', 0, None), kwargs = {}
handler = <swh.graph.backend.JavaStreamProxy._HandlerWrapper object at 0x7fe55406a320>
reader = <async_generator object JavaStreamProxy.read_node_ids at 0x7fe5541af2f0>
java_task = <Task finished coro=<JavaStreamProxy._HandlerWrapper.__getattr__.<locals>.java_call() done, defined at /var/lib/jenkin...tat py4j.GatewayConnection.run(GatewayConnection.java:238)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\n\n')>
task_exc = Py4JError('An error occurred while calling o9.visit_paths. Trace:\npy4j.Py4JException: Method visit_paths([class java....\tat py4j.GatewayConnection.run(GatewayConnection.java:238)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\n\n')
async def java_call_iterator(*args, **kwargs):
with self.get_handler() as (handler, reader):
java_task = getattr(handler, name)(*args, **kwargs)
try:
> async for value in reader:
.tox/py3/lib/python3.7/site-packages/swh/graph/backend.py:189:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <swh.graph.backend.JavaStreamProxy object at 0x7fe554b88860>
fname = '/tmp/swh-graph-pnypny1z/swh-graph.fifo'
async def read_node_ids(self, fname):
loop = asyncio.get_event_loop()
open_thread = loop.run_in_executor(None, open, fname, "rb")
# Since the open() call on the FIFO is blocking until it is also opened
# on the Java side, we await it with a timeout in case there is an
# exception that prevents the write-side open().
> with (await asyncio.wait_for(open_thread, timeout=2)) as f:
.tox/py3/lib/python3.7/site-packages/swh/graph/backend.py:150:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fut = <Future cancelled>, timeout = 2
async def wait_for(fut, timeout, *, loop=None):
"""Wait for the single Future or coroutine to complete, with timeout.
Coroutine will be wrapped in Task.
Returns result of the Future or coroutine. When a timeout occurs,
it cancels the task and raises TimeoutError. To avoid the task
cancellation, wrap it in shield().
If the wait is cancelled, the task is also cancelled.
This function is a coroutine.
"""
if loop is None:
loop = events.get_event_loop()
if timeout is None:
return await fut
if timeout <= 0:
fut = ensure_future(fut, loop=loop)
if fut.done():
return fut.result()
fut.cancel()
raise futures.TimeoutError()
waiter = loop.create_future()
timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
cb = functools.partial(_release_waiter, waiter)
fut = ensure_future(fut, loop=loop)
fut.add_done_callback(cb)
try:
# wait until the future completes or the timeout
try:
await waiter
except futures.CancelledError:
fut.remove_done_callback(cb)
fut.cancel()
raise
if fut.done():
return fut.result()
else:
fut.remove_done_callback(cb)
# We must ensure that the task is not running
# after wait_for() returns.
# See https://bugs.python.org/issue32751
await _cancel_and_wait(fut, loop=loop)
> raise futures.TimeoutError()
E concurrent.futures._base.TimeoutError
/usr/lib/python3.7/asyncio/tasks.py:423: TimeoutError
During handling of the above exception, another exception occurred:
graph = <swh.graph.graph.Graph object at 0x7fe554b88b70>
def test_visit_paths(graph):
actual = list(
graph["swh:1:snp:0000000000000000000000000000000000000020"].visit_paths(
> edges="snp:*,rev:*"
)
)
.tox/py3/lib/python3.7/site-packages/swh/graph/tests/test_graph.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/graph/graph.py:100: in visit_paths
self.graph.backend.visit_paths, direction, edges, self.id, max_edges
.tox/py3/lib/python3.7/site-packages/swh/graph/graph.py:29: in call_async_gen
res = loop.run_until_complete(it.__anext__())
/usr/lib/python3.7/asyncio/base_events.py:584: in run_until_complete
return future.result()
.tox/py3/lib/python3.7/site-packages/swh/graph/backend.py:115: in visit_paths
direction, edges_fmt, src, max_edges
.tox/py3/lib/python3.7/site-packages/swh/graph/backend.py:198: in java_call_iterator
raise task_exc
.tox/py3/lib/python3.7/site-packages/swh/graph/backend.py:167: in java_call
await loop.run_in_executor(None, lambda: func(*args, **kwargs))
/usr/lib/python3.7/concurrent/futures/thread.py:57: in run
result = self.fn(*self.args, **self.kwargs)
.tox/py3/lib/python3.7/site-packages/swh/graph/backend.py:167: in <lambda>
await loop.run_in_executor(None, lambda: func(*args, **kwargs))
.tox/py3/lib/python3.7/site-packages/py4j/java_gateway.py:1310: in __call__
answer, self.gateway_client, self.target_id, self.name)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
answer = 'xspy4j.Py4JException: Method visit_paths([class java.lang.String, class java.lang.String, class java.lang.Integer, nu...n\tat py4j.GatewayConnection.run(GatewayConnection.java:238)\\n\tat java.base/java.lang.Thread.run(Thread.java:834)\\n'
gateway_client = <py4j.java_gateway.GatewayClient object at 0x7fe554b88b00>
target_id = 'o9', name = 'visit_paths'
def get_return_value(answer, gateway_client, target_id=None, name=None):
"""Converts an answer received from the Java gateway into a Python object.
For example, string representation of integers are converted to Python
integer, string representation of objects are converted to JavaObject
instances, etc.
:param answer: the string returned by the Java gateway
:param gateway_client: the gateway client used to communicate with the Java
Gateway. Only necessary if the answer is a reference (e.g., object,
list, map)
:param target_id: the name of the object from which the answer comes from
(e.g., *object1* in `object1.hello()`). Optional.
:param name: the name of the member from which the answer comes from
(e.g., *hello* in `object1.hello()`). Optional.
"""
if is_error(answer)[0]:
if len(answer) > 1:
type = answer[1]
value = OUTPUT_CONVERTER[type](answer[2:], gateway_client)
if answer[1] == REFERENCE_TYPE:
raise Py4JJavaError(
"An error occurred while calling {0}{1}{2}.\n".
format(target_id, ".", name), value)
else:
raise Py4JError(
"An error occurred while calling {0}{1}{2}. Trace:\n{3}\n".
> format(target_id, ".", name, value))
E py4j.protocol.Py4JError: An error occurred while calling o9.visit_paths. Trace:
E py4j.Py4JException: Method visit_paths([class java.lang.String, class java.lang.String, class java.lang.Integer, null]) does not exist
E at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318)
E at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326)
E at py4j.Gateway.invoke(Gateway.java:274)
E at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
E at py4j.commands.CallCommand.execute(CallCommand.java:79)
E at py4j.GatewayConnection.run(GatewayConnection.java:238)
E at java.base/java.lang.Thread.run(Thread.java:834)
.tox/py3/lib/python3.7/site-packages/py4j/protocol.py:332: Py4JError
TEST RESULT
TEST RESULT
- Run At
- Apr 14 2021, 4:16 PM