diff options
author | Peter Andersson <[email protected]> | 2015-02-06 15:33:34 +0100 |
---|---|---|
committer | Peter Andersson <[email protected]> | 2015-02-06 15:33:34 +0100 |
commit | 483951325bbb25ba33539dde7098e0df9800bc18 (patch) | |
tree | e5bb0f294051eee8749841b9a309e927424c0c5a /lib/common_test/src/ct_telnet.erl | |
parent | fdc939b00444e4d0904c91cb3618eafe820eebec (diff) | |
download | otp-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/ct_telnet.erl')
-rw-r--r-- | lib/common_test/src/ct_telnet.erl | 3 |
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. |