def test_rpc(
self, container, entrypoint_tracker, rpc_proxy, wait_for_result,
backoff_count
):
""" RPC entrypoint supports backoff
"""
with entrypoint_waiter(
container, 'method', callback=wait_for_result
) as result:
res = rpc_proxy.service.method("arg")
assert res == result.get() == "result"
# entrypoint fired backoff_count + 1 times
assert entrypoint_tracker.get_results() == (
[None] * backoff_count + ["result"]
)
# entrypoint raised `Backoff` for all but the last execution
assert entrypoint_tracker.get_exceptions() == (
[(Backoff, ANY, ANY)] * backoff_count + [None]
)
评论列表
文章目录