From 8436e96544d79a5b5d32221925f60334cc33b205 Mon Sep 17 00:00:00 2001 From: juhlig Date: Mon, 3 Jun 2019 09:47:31 +0200 Subject: Fix many conns_sups tests for Windows --- test/notify_and_wait_protocol.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/notify_and_wait_protocol.erl') 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. -- cgit v1.2.3