aboutsummaryrefslogtreecommitdiffstats
path: root/test/gun_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/gun_SUITE.erl')
-rw-r--r--test/gun_SUITE.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/gun_SUITE.erl b/test/gun_SUITE.erl
index a0ecddd..715bec5 100644
--- a/test/gun_SUITE.erl
+++ b/test/gun_SUITE.erl
@@ -384,6 +384,20 @@ retry_timeout(_) ->
error(shutdown_too_late)
end.
+set_owner(_) ->
+ doc("The owner of the connection can be changed."),
+ Self = self(),
+ Pid = spawn(fun() ->
+ {ok, ConnPid} = gun:open("localhost", 12345),
+ gun:set_owner(ConnPid, Self),
+ Self ! {conn, ConnPid}
+ end),
+ Ref = monitor(process, Pid),
+ receive {'DOWN', Ref, process, Pid, _} -> ok after 1000 -> error(timeout) end,
+ ConnPid = receive {conn, C} -> C after 1000 -> error(timeout) end,
+ #{owner := Self} = gun:info(ConnPid),
+ gun:close(ConnPid).
+
shutdown_reason(_) ->
doc("The last connection failure must be propagated."),
{ok, Pid} = gun:open("localhost", 12345, #{retry => 0}),