aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2015-03-06 12:18:05 +0100
committerPeter Andersson <[email protected]>2015-03-06 12:18:05 +0100
commit6b635b516a6721d5b6a7b08e501004857175a183 (patch)
tree5b313085f65c2dfa1443b35a0b1b573690c88e79 /lib/common_test/src
parente6d39e161f14f5d9a4dc9c44ee1f31b47343567a (diff)
parent483951325bbb25ba33539dde7098e0df9800bc18 (diff)
downloadotp-6b635b516a6721d5b6a7b08e501004857175a183.tar.gz
otp-6b635b516a6721d5b6a7b08e501004857175a183.tar.bz2
otp-6b635b516a6721d5b6a7b08e501004857175a183.zip
Merge branch 'peppe/common_test/ct_telnet_timeout_error' into maint
* peppe/common_test/ct_telnet_timeout_error: 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.