Made all timeout errors return timeout in seconds
This commit is contained in:
parent
8bf840e6a2
commit
52a5488025
|
|
@ -37,6 +37,7 @@ defmodule RpcStream do
|
||||||
case :rabbit_misc.rpc_call(node, mod, fun, args, ref, pid, timeout) do
|
case :rabbit_misc.rpc_call(node, mod, fun, args, ref, pid, timeout) do
|
||||||
{:error, _} = error -> send(pid, {:error, error});
|
{:error, _} = error -> send(pid, {:error, error});
|
||||||
{:bad_argument, _} = error -> send(pid, {:error, error});
|
{:bad_argument, _} = error -> send(pid, {:error, error});
|
||||||
|
{:badrpc, :timeout} -> send(pid, {:timeout, timeout});
|
||||||
{:badrpc, _} = error -> send(pid, {:error, error});
|
{:badrpc, _} = error -> send(pid, {:error, error});
|
||||||
_ -> :ok
|
_ -> :ok
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ defmodule ListBindingsCommandTest do
|
||||||
test "zero timeout causes command to return badrpc", context do
|
test "zero timeout causes command to return badrpc", context do
|
||||||
capture_io(fn ->
|
capture_io(fn ->
|
||||||
assert ListBindingsCommand.run([], context[:opts]) ==
|
assert ListBindingsCommand.run([], context[:opts]) ==
|
||||||
[{:badrpc, :timeout}]
|
[{:badrpc, {:timeout, 0.0}}]
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ defmodule ListChannelsCommandTest do
|
||||||
test "zero timeout causes command to return badrpc", context do
|
test "zero timeout causes command to return badrpc", context do
|
||||||
capture_io(fn ->
|
capture_io(fn ->
|
||||||
assert ListChannelsCommand.run([], context[:opts]) ==
|
assert ListChannelsCommand.run([], context[:opts]) ==
|
||||||
[{:badrpc, :timeout}]
|
[{:badrpc, {:timeout, 0.0}}]
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ defmodule ListConnectionsCommandTest do
|
||||||
test "zero timeout causes command to return badrpc", context do
|
test "zero timeout causes command to return badrpc", context do
|
||||||
capture_io(fn ->
|
capture_io(fn ->
|
||||||
assert ListConnectionsCommand.run([], context[:opts]) ==
|
assert ListConnectionsCommand.run([], context[:opts]) ==
|
||||||
[{:badrpc, :timeout}]
|
[{:badrpc, {:timeout, 0.0}}]
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ defmodule ListConsumersCommandTest do
|
||||||
test "zero timeout causes command to return badrpc", context do
|
test "zero timeout causes command to return badrpc", context do
|
||||||
capture_io(fn ->
|
capture_io(fn ->
|
||||||
assert ListConsumersCommand.run([], context[:opts]) ==
|
assert ListConsumersCommand.run([], context[:opts]) ==
|
||||||
[{:badrpc, :timeout}]
|
[{:badrpc, {:timeout, 0.0}}]
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ defmodule ListExchangesCommandTest do
|
||||||
test "zero timeout causes command to return badrpc", context do
|
test "zero timeout causes command to return badrpc", context do
|
||||||
capture_io(fn ->
|
capture_io(fn ->
|
||||||
assert ListExchangesCommand.run([], context[:opts]) ==
|
assert ListExchangesCommand.run([], context[:opts]) ==
|
||||||
[{:badrpc, :timeout}]
|
[{:badrpc, {:timeout, 0.0}}]
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ defmodule ListQueuesCommandTest do
|
||||||
test "zero timeout causes command to return badrpc", context do
|
test "zero timeout causes command to return badrpc", context do
|
||||||
capture_io(fn ->
|
capture_io(fn ->
|
||||||
assert ListQueuesCommand.run([], context[:opts]) ==
|
assert ListQueuesCommand.run([], context[:opts]) ==
|
||||||
[{:badrpc, :timeout}]
|
[{:badrpc, {:timeout, 0.0}}]
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ defmodule RpcStreamTest do
|
||||||
test "emission timeout 0 return badrpc" do
|
test "emission timeout 0 return badrpc" do
|
||||||
items = RpcStream.receive_list_items(Kernel.node, TestHelper, :emit_list, [[]], 0, [])
|
items = RpcStream.receive_list_items(Kernel.node, TestHelper, :emit_list, [[]], 0, [])
|
||||||
|
|
||||||
assert [{:badrpc, :timeout}] == items
|
assert [{:badrpc, {:timeout, 0.0}}] == items
|
||||||
end
|
end
|
||||||
|
|
||||||
test "emission timeout return badrpc with timeout value in seconds" do
|
test "emission timeout return badrpc with timeout value in seconds" do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue