aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-02-06 15:33:34 +0100
committerPeter Andersson <[email protected]>2015-02-06 15:33:34 +0100
commit483951325bbb25ba33539dde7098e0df9800bc18 (patch)
treee5bb0f294051eee8749841b9a309e927424c0c5a /lib/common_test/src
parentfdc939b00444e4d0904c91cb3618eafe820eebec (diff)
downloadotp-483951325bbb25ba33539dde7098e0df9800bc18.tar.gz
otp-483951325bbb25ba33539dde7098e0df9800bc18.tar.bz2
otp-483951325bbb25ba33539dde7098e0df9800bc18.zip
Make sure total_timeout can get triggered before idle_timeout
OTP-12335
Diffstat (limited to 'lib/common_test/src')
-rw-r--r--lib/common_test/src/ct_telnet.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_telnet.erl b/lib/common_test/src/ct_telnet.erl
index babe73e575..4e03bf8630 100644
--- a/lib/common_test/src/ct_telnet.erl
+++ b/lib/common_test/src/ct_telnet.erl
@@ -1122,7 +1122,8 @@ teln_expect1(Name,Pid,Data,Pattern,Acc,EO=#eo{idle_timeout=IdleTO,
NotFinished ->
%% Get more data
Fun = fun() -> get_data1(EO#eo.teln_pid) end,
- case timer:tc(ct_gen_conn, do_within_time, [Fun, IdleTO]) of
+ BreakAfter = if TotalTO < IdleTO -> TotalTO; true -> IdleTO end,
+ case timer:tc(ct_gen_conn, do_within_time, [Fun, BreakAfter]) of
{_,{error,Reason}} ->
%% A timeout will occur when the telnet connection
%% is idle for EO#eo.idle_timeout milliseconds.