From 7f86a0fedf5a18d82817ceb530aae0f8167c9354 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 10 Aug 2016 15:24:30 +0200 Subject: run_erl: Add sleepy_child test case with run_erl option -sleepy-child to provoke race when slave pty is late --- erts/etc/unix/run_erl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'erts/etc') diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c index f8b5da47ab..6a92e18648 100644 --- a/erts/etc/unix/run_erl.c +++ b/erts/etc/unix/run_erl.c @@ -240,6 +240,7 @@ int main(int argc, char **argv) int off_argv; int calculated_pipename = 0; int highest_pipe_num = 0; + int sleepy_child = 0; program_name = argv[0]; @@ -250,6 +251,11 @@ int main(int argc, char **argv) init_outbuf(); + if (!strcmp(argv[1],"-sleepy-child")) { /* For test purpose only */ + sleepy_child = 1; + ++i; + } + if (!strcmp(argv[1],"-daemon")) { daemon_init(); ++i; @@ -392,6 +398,9 @@ int main(int argc, char **argv) exit(1); } if (childpid == 0) { + if (sleepy_child) + sleep(1); + /* Child */ sf_close(mfd); /* disassociate from control terminal */ -- cgit v1.2.3