From 59fa8124370d63dc810ff27dde3f20d2aa6fc523 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Fri, 20 May 2016 08:44:09 +0200
Subject: erts: Require more memory for debug tests
---
erts/emulator/test/process_SUITE.erl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index eaa4026a8a..94adfe5cad 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -2585,7 +2585,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();
--
cgit v1.2.3
From d01f67ffaefbfc6cad980f0d58f38891c674c652 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Tue, 31 May 2016 15:06:02 +0200
Subject: erts: fix atom_roundtrip_r15b tc
if node fails to start, just skip testcase
---
erts/emulator/test/distribution_SUITE.erl | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl
index d0096fb1bc..258ae57e18 100644
--- a/erts/emulator/test/distribution_SUITE.erl
+++ b/erts/emulator/test/distribution_SUITE.erl
@@ -1037,10 +1037,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.
--
cgit v1.2.3
From b847766d2c4ab26ba7c720cc7b46fefd2efaf1e0 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Tue, 31 May 2016 16:09:25 +0200
Subject: erl_interface: Fix signed int overflow tc bug
---
lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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");
--
cgit v1.2.3
From 7d0c75c91cbe903868efc51ffa6c721fe29447a2 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Wed, 1 Jun 2016 15:46:46 +0200
Subject: ssl: Fix use_interface dist_SSL test
Doing inet:port will cause an port_control to be sent to
the port, and not all ports in the vm can handle having
arbitrary data sent to them.
---
lib/ssl/test/ssl_dist_SUITE.erl | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/ssl/test/ssl_dist_SUITE.erl b/lib/ssl/test/ssl_dist_SUITE.erl
index e7cbfa63f4..2cf74ba37f 100644
--- a/lib/ssl/test/ssl_dist_SUITE.erl
+++ b/lib/ssl/test/ssl_dist_SUITE.erl
@@ -410,7 +410,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.
@@ -453,9 +453,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
--
cgit v1.2.3
From 4a96eb9dadf453724860a7e2e060894dca360fd6 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Tue, 31 May 2016 14:40:25 +0200
Subject: os_mon: Make sure to start/stop os_mon in tests correctly
---
lib/os_mon/test/cpu_sup_SUITE.erl | 2 +-
lib/os_mon/test/os_mon_SUITE.erl | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
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),
--
cgit v1.2.3
From 7187d9a2c3728b1b32e9403ebb97e53c66e9b261 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Tue, 31 May 2016 14:39:58 +0200
Subject: kernel: Fix t_recv_delim on bsd
TCP messages to not travel instantly on loopback on bsd,
to we have to wait a little while for them to arrive.
---
lib/kernel/test/gen_tcp_api_SUITE.erl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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.
--
cgit v1.2.3
From 7c300789fffeacb24f1d00aa6e0797e06166c3c6 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Fri, 3 Jun 2016 11:59:54 +0200
Subject: kernel: Better explain controlling_process' tcp behaviour
---
lib/kernel/doc/src/gen_tcp.xml | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml
index 8bd94892ad..15a2f02c76 100644
--- a/lib/kernel/doc/src/gen_tcp.xml
+++ b/lib/kernel/doc/src/gen_tcp.xml
@@ -223,6 +223,14 @@ do_recv(Sock, Bs) ->
that receives messages from the socket. If called by any other
process than the current controlling process,
{error, not_owner} is returned.
+ 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.
--
cgit v1.2.3
From d837c512bff62d5ad932cda615a340ad088a8999 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Fri, 3 Jun 2016 16:46:52 +0200
Subject: erts: Ensure bs_add_overflow test has enough memory
---
erts/emulator/test/bs_construct_SUITE.erl | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl
index 941cb435f7..4a2bbf69fd 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.
@@ -906,10 +913,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,_}} =
@@ -918,5 +929,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.
--
cgit v1.2.3
From f18d6eb9d6900e21cefe3ce44b644015a0444279 Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Tue, 31 May 2016 14:36:40 +0200
Subject: erts: Fix distribution_SUITE:bulk_send_bigbig on windows
The granualarity of the windows time sometimes makes timer:tc
return 0 as the time taken for the test. Change this to use
the most common time instead.
---
erts/emulator/test/distribution_SUITE.erl | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/erts/emulator/test/distribution_SUITE.erl b/erts/emulator/test/distribution_SUITE.erl
index 258ae57e18..0b5fdbd7ff 100644
--- a/erts/emulator/test/distribution_SUITE.erl
+++ b/erts/emulator/test/distribution_SUITE.erl
@@ -182,8 +182,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),
--
cgit v1.2.3
From 9411a2098d983cac05fd7198bba26b9d56aa484a Mon Sep 17 00:00:00 2001
From: Lukas Larsson
Date: Fri, 20 May 2016 11:55:45 +0200
Subject: erts: Increase bif and nif call_time trace test
This makes the time that the tests execute longer, which means
that on systems with low resolution on timers (e.g. windows)
the test is less likely to fail.
---
erts/emulator/test/trace_call_time_SUITE.erl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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]),
--
cgit v1.2.3