aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-06-14 10:22:40 +0200
committerLukas Larsson <[email protected]>2016-06-14 10:22:40 +0200
commit1418cbbb689dc2c88ecceaedb4eba33061d338e7 (patch)
tree348257a01f32af0ceb349933c4a7dbe64c884df7
parent0c8357d15dd2573331056a308e3744927ce406ad (diff)
parent9411a2098d983cac05fd7198bba26b9d56aa484a (diff)
downloadotp-1418cbbb689dc2c88ecceaedb4eba33061d338e7.tar.gz
otp-1418cbbb689dc2c88ecceaedb4eba33061d338e7.tar.bz2
otp-1418cbbb689dc2c88ecceaedb4eba33061d338e7.zip
Merge branch 'lukas/erts/testfixes-19'
* lukas/erts/testfixes-19: erts: Increase bif and nif call_time trace test erts: Fix distribution_SUITE:bulk_send_bigbig on windows erts: Ensure bs_add_overflow test has enough memory kernel: Better explain controlling_process' tcp behaviour kernel: Fix t_recv_delim on bsd os_mon: Make sure to start/stop os_mon in tests correctly ssl: Fix use_interface dist_SSL test erl_interface: Fix signed int overflow tc bug erts: fix atom_roundtrip_r15b tc erts: Require more memory for debug tests
-rw-r--r--erts/emulator/test/bs_construct_SUITE.erl20
-rw-r--r--erts/emulator/test/distribution_SUITE.erl20
-rw-r--r--erts/emulator/test/process_SUITE.erl5
-rw-r--r--erts/emulator/test/trace_call_time_SUITE.erl4
-rw-r--r--lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c4
-rw-r--r--lib/kernel/doc/src/gen_tcp.xml8
-rw-r--r--lib/kernel/test/gen_tcp_api_SUITE.erl4
-rw-r--r--lib/os_mon/test/cpu_sup_SUITE.erl2
-rw-r--r--lib/os_mon/test/os_mon_SUITE.erl9
-rw-r--r--lib/ssl/test/ssl_dist_SUITE.erl10
10 files changed, 65 insertions, 21 deletions
diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl
index 22a1c0b765..95042ac802 100644
--- a/erts/emulator/test/bs_construct_SUITE.erl
+++ b/erts/emulator/test/bs_construct_SUITE.erl
@@ -23,6 +23,7 @@
-module(bs_construct_SUITE).
-export([all/0, suite/0,
+ init_per_suite/1, end_per_suite/1,
test1/1, test2/1, test3/1, test4/1, test5/1, testf/1,
not_used/1, in_guard/1,
mem_leak/1, coerce_to_float/1, bjorn/1,
@@ -43,6 +44,12 @@ all() ->
copy_writable_binary, kostis, dynamic, bs_add, otp_7422, zero_width,
bad_append, bs_add_overflow].
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ application:stop(os_mon).
+
big(1) ->
57285702734876389752897683.
@@ -882,10 +889,14 @@ append_unit_16(Bin) ->
%% Produce a large result of bs_add that, if cast to signed int, would overflow
%% into a negative number that fits a smallnum.
-bs_add_overflow(Config) ->
+bs_add_overflow(_Config) ->
+ Memsize = memsize(),
+ io:format("Memsize = ~w Bytes~n", [Memsize]),
case erlang:system_info(wordsize) of
8 ->
{skip, "64-bit architecture"};
+ _ when Memsize < (2 bsl 30) ->
+ {skip, "Less then 2 GB of memory"};
4 ->
Large = <<0:((1 bsl 30)-1)>>,
{'EXIT',{system_limit,_}} =
@@ -894,5 +905,10 @@ bs_add_overflow(Config) ->
Large/bits>>),
ok
end.
-
+
id(I) -> I.
+
+memsize() ->
+ application:ensure_all_started(os_mon),
+ {Tot,_Used,_} = memsup:get_memory_data(),
+ Tot.
diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl
index 26780f6017..c6939a695d 100644
--- a/erts/emulator/test/distribution_SUITE.erl
+++ b/erts/emulator/test/distribution_SUITE.erl
@@ -187,8 +187,13 @@ bulk_sendsend2(Terms, BinSize, BusyBufSize) ->
{ok, NodeSend} = start_node(bulk_sender, "+zdbbl " ++ integer_to_list(BusyBufSize)),
_Send = spawn(NodeSend, erlang, apply, [fun sendersender/4, [self(), Recv, Bin, Terms]]),
{Elapsed, {_TermsN, SizeN}, MonitorCount} =
- receive {sendersender, BigRes} ->
- BigRes
+ receive
+ %% On some platforms (windows), the time taken is 0 so we
+ %% simulate that some little time has passed.
+ {sendersender, {0.0,T,MC}} ->
+ {0.0015, T, MC};
+ {sendersender, BigRes} ->
+ BigRes
end,
stop_node(NodeRecv),
stop_node(NodeSend),
@@ -1042,10 +1047,13 @@ atom_roundtrip_r15b(Config) when is_list(Config) ->
ct:timetrap({minutes, 6}),
AtomData = atom_data(),
verify_atom_data(AtomData),
- {ok, Node} = start_node(Config, [], "r15b"),
- do_atom_roundtrip(Node, AtomData),
- stop_node(Node),
- ok;
+ case start_node(Config, [], "r15b") of
+ {ok, Node} ->
+ do_atom_roundtrip(Node, AtomData),
+ stop_node(Node);
+ {error, timeout} ->
+ {skip,"Unable to start OTP R15B release"}
+ end;
false ->
{skip,"No OTP R15B available"}
end.
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index 4ebc1f5782..dae8990f56 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -2581,7 +2581,10 @@ enable_internal_state() ->
_ -> erts_debug:set_internal_state(available_internal_state, true)
end.
-sys_mem_cond_run(ReqSizeMB, TestFun) when is_integer(ReqSizeMB) ->
+sys_mem_cond_run(OrigReqSizeMB, TestFun) when is_integer(OrigReqSizeMB) ->
+ %% Debug normally needs more memory, so double the requirement
+ Debug = erlang:system_info(debug_compiled),
+ ReqSizeMB = if Debug -> OrigReqSizeMB * 2; true -> OrigReqSizeMB end,
case total_memory() of
TotMem when is_integer(TotMem), TotMem >= ReqSizeMB ->
TestFun();
diff --git a/erts/emulator/test/trace_call_time_SUITE.erl b/erts/emulator/test/trace_call_time_SUITE.erl
index 40c8bc4340..6582ad134b 100644
--- a/erts/emulator/test/trace_call_time_SUITE.erl
+++ b/erts/emulator/test/trace_call_time_SUITE.erl
@@ -351,7 +351,7 @@ combo(Config) when is_list(Config) ->
%% Tests tracing of bifs
bif(Config) when is_list(Config) ->
P = erlang:trace_pattern({'_','_','_'}, false, [call_time]),
- M = 1000000,
+ M = 5000000,
%%
2 = erlang:trace_pattern({erlang, binary_to_term, '_'}, true, [call_time]),
2 = erlang:trace_pattern({erlang, term_to_binary, '_'}, true, [call_time]),
@@ -381,7 +381,7 @@ bif(Config) when is_list(Config) ->
nif(Config) when is_list(Config) ->
load_nif(Config),
P = erlang:trace_pattern({'_','_','_'}, false, [call_time]),
- M = 1000000,
+ M = 5000000,
%%
1 = erlang:trace_pattern({?MODULE, nif_dec, '_'}, true, [call_time]),
1 = erlang:trace_pattern({?MODULE, with_nif, '_'}, true, [call_time]),
diff --git a/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c b/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c
index 687a45bbab..d97f218a26 100644
--- a/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c
+++ b/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c
@@ -149,7 +149,7 @@ TESTCASE(round_trip_conversion)
{
int v;
- for (v = 8; v; v <<= 1) {
+ for (v = 8, n = 0; n < (sizeof(v)*8-4-1); v <<= 1, n++) {
for (i=-4; i<4; i++) {
encode_decode(erl_mk_int(v+i), "INT");
encode_decode(erl_mk_int(-(v+i)), "NEG INT");
@@ -166,7 +166,7 @@ TESTCASE(round_trip_conversion)
}
{
long long v;
- for (v = 8; v; v <<= 1) {
+ for (v = 8, n = 0; n < (sizeof(v)*8-4-1); v <<= 1, n++) {
for (i=-4; i<4; i++) {
encode_decode(erl_mk_longlong(v+i), "LONGLONG");
encode_decode(erl_mk_longlong(-(v+i)), "NEG LONGLONG");
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml
index 88135ea43d..83242c2df8 100644
--- a/lib/kernel/doc/src/gen_tcp.xml
+++ b/lib/kernel/doc/src/gen_tcp.xml
@@ -232,6 +232,14 @@ do_recv(Sock, Bs) ->
that receives messages from the socket. If called by any other
process than the current controlling process,
<c>{error, not_owner}</c> is returned.</p>
+ <p>If the socket is set in active mode, this function
+ will transfer any messages in the mailbox of the caller
+ to the new controlling process.
+ If any other process is interacting with the socket while
+ the transfer is happening, the transfer may not work correctly
+ and messages may remain in the caller's mailbox. For instance
+ changing the sockets active mode before the transfere is complete
+ may cause this.</p>
</desc>
</func>
diff --git a/lib/kernel/test/gen_tcp_api_SUITE.erl b/lib/kernel/test/gen_tcp_api_SUITE.erl
index 6f6f53309e..54298e6309 100644
--- a/lib/kernel/test/gen_tcp_api_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_api_SUITE.erl
@@ -135,8 +135,8 @@ t_recv_delim(Config) when is_list(Config) ->
{ok, Client} = gen_tcp:connect(localhost, Port, Opts),
{ok, A} = gen_tcp:accept(L),
ok = gen_tcp:send(A, "abcXefgX"),
- {ok, "abcX"} = gen_tcp:recv(Client, 0, 0),
- {ok, "efgX"} = gen_tcp:recv(Client, 0, 0),
+ {ok, "abcX"} = gen_tcp:recv(Client, 0, 200),
+ {ok, "efgX"} = gen_tcp:recv(Client, 0, 200),
ok = gen_tcp:close(Client),
ok = gen_tcp:close(A),
ok.
diff --git a/lib/os_mon/test/cpu_sup_SUITE.erl b/lib/os_mon/test/cpu_sup_SUITE.erl
index 41115ee6e2..7122d23503 100644
--- a/lib/os_mon/test/cpu_sup_SUITE.erl
+++ b/lib/os_mon/test/cpu_sup_SUITE.erl
@@ -256,7 +256,7 @@ unavailable(Config) when is_list(Config) ->
restart(Config) when is_list(Config) ->
ok = application:set_env(os_mon, start_cpu_sup, true),
- {ok, _Pid} = supervisor:restart_child(os_mon_sup, cpu_sup),
+ supervisor:restart_child(os_mon_sup, cpu_sup),
ok.
%% Aux
diff --git a/lib/os_mon/test/os_mon_SUITE.erl b/lib/os_mon/test/os_mon_SUITE.erl
index 033a5ae162..c373b5d851 100644
--- a/lib/os_mon/test/os_mon_SUITE.erl
+++ b/lib/os_mon/test/os_mon_SUITE.erl
@@ -21,7 +21,7 @@
-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
--export([all/0, suite/0]).
+-export([all/0, suite/0, init_per_suite/1, end_per_suite/1]).
%% Test cases
-export([app_file/1, appup_file/1, config/1]).
@@ -36,6 +36,13 @@ all() ->
_OS -> [app_file, appup_file]
end.
+init_per_suite(Config) ->
+ Config.
+
+end_per_suite(_Config) ->
+ application:stop(os_mon),
+ ok.
+
%% Testing .app file
app_file(Config) when is_list(Config) ->
ok = test_server:app_test(os_mon),
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl
index f0ce82f4fe..5ebf9bb2de 100644
--- a/lib/ssl/test/ssl_dist_SUITE.erl
+++ b/lib/ssl/test/ssl_dist_SUITE.erl
@@ -413,7 +413,7 @@ use_interface(Config) when is_list(Config) ->
NH1,
fun() ->
[inet:sockname(P) ||
- P <- erlang:ports(),
+ P <- inet_ports(),
{ok, Port} =:= (catch inet:port(P))]
end),
%% And check that it's actually listening on localhost.
@@ -705,9 +705,11 @@ try_setting_priority(TestFun, Config) ->
get_socket_priorities() ->
[Priority ||
{ok,[{priority,Priority}]} <-
- [inet:getopts(Port, [priority]) ||
- Port <- erlang:ports(),
- element(2, erlang:port_info(Port, name)) =:= "tcp_inet"]].
+ [inet:getopts(Port, [priority]) || Port <- inet_ports()]].
+
+inet_ports() ->
+ [Port || Port <- erlang:ports(),
+ element(2, erlang:port_info(Port, name)) =:= "tcp_inet"].
%%
%% test_server side api