aboutsummaryrefslogtreecommitdiffstats
path: root/test/notify_and_wait_protocol.erl
diff options
context:
space:
mode:
authorjuhlig <[email protected]>2019-06-03 09:47:31 +0200
committerjuhlig <[email protected]>2019-06-03 09:47:31 +0200
commit8436e96544d79a5b5d32221925f60334cc33b205 (patch)
treeaa5a85fd8abcad711dd80d935afe38161b878e8c /test/notify_and_wait_protocol.erl
parent30604262b5934b38e9f55f0d3ef44f8aed5310de (diff)
downloadranch-8436e96544d79a5b5d32221925f60334cc33b205.tar.gz
ranch-8436e96544d79a5b5d32221925f60334cc33b205.tar.bz2
ranch-8436e96544d79a5b5d32221925f60334cc33b205.zip
Fix many conns_sups tests for Windows
Diffstat (limited to 'test/notify_and_wait_protocol.erl')
-rw-r--r--test/notify_and_wait_protocol.erl11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/notify_and_wait_protocol.erl b/test/notify_and_wait_protocol.erl
index e3e857b..37d0f42 100644
--- a/test/notify_and_wait_protocol.erl
+++ b/test/notify_and_wait_protocol.erl
@@ -2,12 +2,13 @@
-behaviour(ranch_protocol).
-export([start_link/3]).
--export([init/2]).
+-export([init/3]).
-start_link(_, _, [{msg, Msg}, {pid, TestPid}]) ->
- Pid = spawn_link(?MODULE, init, [Msg, TestPid]),
+start_link(_, _, Opts = #{msg := Msg, pid := TestPid}) ->
+ Timeout = maps:get(timeout, Opts, 2500),
+ Pid = spawn_link(?MODULE, init, [Msg, TestPid, Timeout]),
{ok, Pid}.
-init(Msg, Pid) ->
+init(Msg, Pid, Timeout) ->
Pid ! Msg,
- receive after 2500 -> ok end.
+ receive after Timeout -> ok end.