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
|
||||
{:error, _} = error -> send(pid, {:error, error});
|
||||
{:bad_argument, _} = error -> send(pid, {:error, error});
|
||||
{:badrpc, :timeout} -> send(pid, {:timeout, timeout});
|
||||
{:badrpc, _} = error -> send(pid, {:error, error});
|
||||
_ -> :ok
|
||||
end
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ defmodule ListBindingsCommandTest do
|
|||
test "zero timeout causes command to return badrpc", context do
|
||||
capture_io(fn ->
|
||||
assert ListBindingsCommand.run([], context[:opts]) ==
|
||||
[{:badrpc, :timeout}]
|
||||
[{:badrpc, {:timeout, 0.0}}]
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ defmodule ListChannelsCommandTest do
|
|||
test "zero timeout causes command to return badrpc", context do
|
||||
capture_io(fn ->
|
||||
assert ListChannelsCommand.run([], context[:opts]) ==
|
||||
[{:badrpc, :timeout}]
|
||||
[{:badrpc, {:timeout, 0.0}}]
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ defmodule ListConnectionsCommandTest do
|
|||
test "zero timeout causes command to return badrpc", context do
|
||||
capture_io(fn ->
|
||||
assert ListConnectionsCommand.run([], context[:opts]) ==
|
||||
[{:badrpc, :timeout}]
|
||||
[{:badrpc, {:timeout, 0.0}}]
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ defmodule ListConsumersCommandTest do
|
|||
test "zero timeout causes command to return badrpc", context do
|
||||
capture_io(fn ->
|
||||
assert ListConsumersCommand.run([], context[:opts]) ==
|
||||
[{:badrpc, :timeout}]
|
||||
[{:badrpc, {:timeout, 0.0}}]
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ defmodule ListExchangesCommandTest do
|
|||
test "zero timeout causes command to return badrpc", context do
|
||||
capture_io(fn ->
|
||||
assert ListExchangesCommand.run([], context[:opts]) ==
|
||||
[{:badrpc, :timeout}]
|
||||
[{:badrpc, {:timeout, 0.0}}]
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ defmodule ListQueuesCommandTest do
|
|||
test "zero timeout causes command to return badrpc", context do
|
||||
capture_io(fn ->
|
||||
assert ListQueuesCommand.run([], context[:opts]) ==
|
||||
[{:badrpc, :timeout}]
|
||||
[{:badrpc, {:timeout, 0.0}}]
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ defmodule RpcStreamTest do
|
|||
test "emission timeout 0 return badrpc" do
|
||||
items = RpcStream.receive_list_items(Kernel.node, TestHelper, :emit_list, [[]], 0, [])
|
||||
|
||||
assert [{:badrpc, :timeout}] == items
|
||||
assert [{:badrpc, {:timeout, 0.0}}] == items
|
||||
end
|
||||
|
||||
test "emission timeout return badrpc with timeout value in seconds" do
|
||||
|
|
|
|||
Loading…
Reference in New Issue