diff options
author | Siri Hansen <[email protected]> | 2015-12-09 11:48:08 +0100 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2015-12-09 11:48:08 +0100 |
commit | 9d80569b209d37f711ca55c4673d8dd8fbf614fa (patch) | |
tree | b4ca40f3a7dec82a0da440d15050432d38deb7c8 /lib/common_test/test/ct_netconfc_SUITE_data/ns.erl | |
parent | 8f91fc9576aa4abadf7e20e5aaabec1b37832145 (diff) | |
parent | 976214f8d738d4852348496df79f84264d899aba (diff) | |
download | otp-9d80569b209d37f711ca55c4673d8dd8fbf614fa.tar.gz otp-9d80569b209d37f711ca55c4673d8dd8fbf614fa.tar.bz2 otp-9d80569b209d37f711ca55c4673d8dd8fbf614fa.zip |
Merge branch 'siri/ct_netconfc/slow-down/OTP-13007' into maint
* siri/ct_netconfc/slow-down/OTP-13007:
Extended table_trans timer in order to handle big data on slow machines
Don't log headings without content
Speed up receive of many small packages
Conflicts:
lib/common_test/src/ct_conn_log_h.erl
Diffstat (limited to 'lib/common_test/test/ct_netconfc_SUITE_data/ns.erl')
-rw-r--r-- | lib/common_test/test/ct_netconfc_SUITE_data/ns.erl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl index 8c30383343..07893faabc 100644 --- a/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl +++ b/lib/common_test/test/ct_netconfc_SUITE_data/ns.erl @@ -277,6 +277,18 @@ hupp_kill(State = #session{connection = ConnRef}) -> send({CM,Ch},Data) -> ssh_connection:send(CM, Ch, Data). +%%% Split into many small parts and send to client +send_frag({CM,Ch},Data) -> + Sz = rand:uniform(2000), + case Data of + <<Chunk:Sz/binary,Rest/binary>> -> + ssh_connection:send(CM, Ch, Chunk), + send_frag({CM,Ch},Rest); + Chunk -> + ssh_connection:send(CM, Ch, Chunk) + end. + + %%% Kill ssh connection kill({CM,_Ch}) -> ssh:close(CM). @@ -294,7 +306,7 @@ table_trans(Fun,Args) -> receive {table_trans_done,Result} -> Result - after 5000 -> + after 20000 -> exit(table_trans_timeout) end end. @@ -424,6 +436,9 @@ do(_, undefined) -> reply(_,undefined) -> ?dbg("no reply~n",[]), ok; +reply(ConnRef,{fragmented,Reply}) -> + ?dbg("Reply fragmented: ~p~n",[Reply]), + send_frag(ConnRef,make_msg(Reply)); reply(ConnRef,Reply) -> ?dbg("Reply: ~p~n",[Reply]), send(ConnRef, make_msg(Reply)). |