diff options
author | Sverker Eriksson <[email protected]> | 2016-08-10 15:24:30 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-08-10 15:24:30 +0200 |
commit | 7f86a0fedf5a18d82817ceb530aae0f8167c9354 (patch) | |
tree | 29ce1d7b2e83653480559b87bca4d40c550f4e9e /erts/test/run_erl_SUITE.erl | |
parent | acf0330b0f5b1f4b8fc411cac45f57348b459525 (diff) | |
download | otp-7f86a0fedf5a18d82817ceb530aae0f8167c9354.tar.gz otp-7f86a0fedf5a18d82817ceb530aae0f8167c9354.tar.bz2 otp-7f86a0fedf5a18d82817ceb530aae0f8167c9354.zip |
run_erl: Add sleepy_child test case
with run_erl option -sleepy-child
to provoke race when slave pty is late
Diffstat (limited to 'erts/test/run_erl_SUITE.erl')
-rw-r--r-- | erts/test/run_erl_SUITE.erl | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/erts/test/run_erl_SUITE.erl b/erts/test/run_erl_SUITE.erl index 47d38bde7c..fe1ccba1e2 100644 --- a/erts/test/run_erl_SUITE.erl +++ b/erts/test/run_erl_SUITE.erl @@ -22,6 +22,7 @@ -export([all/0, suite/0]). -export([basic/1,heavy/1,heavier/1,defunct/1]). +-export([sleepy_child/1]). -export([ping_me_back/1]). -include_lib("common_test/include/ct.hrl"). @@ -31,17 +32,17 @@ suite() -> {timetrap, {minutes, 2}}]. all() -> - [basic, heavy, heavier, defunct]. + [basic, sleepy_child, heavy, heavier, defunct]. basic(Config) when is_list(Config) -> case os:type() of - {unix,_} -> basic_1(Config); + {unix,_} -> basic_1(Config, "basic", ""); _ -> {skip,"Not Unix"} end. -basic_1(Config) -> - {Node,Pipe} = do_run_erl(Config, "basic"), +basic_1(Config, Case, Opt) -> + {Node,Pipe} = do_run_erl(Config, Case, Opt), ToErl = open_port({spawn,"to_erl "++Pipe}, []), erlang:port_command(ToErl, "halt().\r\n"), @@ -55,6 +56,12 @@ basic_1(Config) -> ok. +sleepy_child(Config) when is_list(Config) -> + case os:type() of + {unix,_} -> basic_1(Config, "sleepy_child", "-sleepy-child "); + _ -> {skip,"Not Unix"} + end. + heavy(Config) when is_list(Config) -> case os:type() of {unix,_} -> heavy_1(Config); @@ -233,12 +240,14 @@ defunct_2(Config, Perl) -> %%% Utilities. do_run_erl(Config, Case) -> + do_run_erl(Config, Case, ""). +do_run_erl(Config, Case, Opt) -> Priv = proplists:get_value(priv_dir, Config), LogDir = filename:join(Priv, Case), ok = file:make_dir(LogDir), Pipe = LogDir ++ "/", NodeName = "run_erl_node_" ++ Case, - Cmd = "run_erl "++Pipe++" "++LogDir++" \"erl -sname " ++ NodeName ++ + Cmd = "run_erl "++Opt++Pipe++" "++LogDir++" \"erl -sname " ++ NodeName ++ " -pa " ++ filename:dirname(code:which(?MODULE)) ++ " -s " ++ ?MODULE_STRING ++ " ping_me_back " ++ atom_to_list(node()) ++ "\"", |