From 901700ad8db2256510210ff66fe9375d6c9f50f0 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 6 Feb 2017 21:47:51 +0100 Subject: [PATCH] test that joining a terminated process still works This patch was provided by Samuel Thibault and (fix #135). As noted by Samuel, this feature used to fail for SimGrid 3.12 and 3.13 but seems to work since 3.14. This new test intends to make sure that it remains this way. Many thanks for that Sam! --- teshsuite/msg/process_join/process_join.c | 7 +++++++ teshsuite/msg/process_join/process_join.tesh | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/teshsuite/msg/process_join/process_join.c b/teshsuite/msg/process_join/process_join.c index 67cb1ad4e0..a19aa05319 100644 --- a/teshsuite/msg/process_join/process_join.c +++ b/teshsuite/msg/process_join/process_join.c @@ -35,6 +35,13 @@ static int master(int argc, char *argv[]) XBT_INFO("Join the slave (timeout 2)"); MSG_process_join(process, 2); + XBT_INFO("Start slave"); + process = MSG_process_create("slave from master", slave, NULL, MSG_host_self()); + XBT_INFO("Waiting 4"); + MSG_process_sleep(4); + XBT_INFO("Join the slave (timeout 1)"); + MSG_process_join(process, 1); + XBT_INFO("Goodbye now!"); MSG_process_sleep(1); diff --git a/teshsuite/msg/process_join/process_join.tesh b/teshsuite/msg/process_join/process_join.tesh index 1eb59c74d8..33a956d245 100644 --- a/teshsuite/msg/process_join/process_join.tesh +++ b/teshsuite/msg/process_join/process_join.tesh @@ -11,7 +11,12 @@ $ ./process_join$EXEEXT ${srcdir:=.}/../../../examples/platforms/small_platform. > [Tremblay:master:(1) 5.000000] [msg_test/INFO] Start slave > [Tremblay:slave from master:(4) 5.000000] [msg_test/INFO] Slave started > [Tremblay:master:(1) 5.000000] [msg_test/INFO] Join the slave (timeout 2) -> [Tremblay:master:(1) 7.000000] [msg_test/INFO] Goodbye now! +> [Tremblay:master:(1) 7.000000] [msg_test/INFO] Start slave +> [Tremblay:slave from master:(5) 7.000000] [msg_test/INFO] Slave started +> [Tremblay:master:(1) 7.000000] [msg_test/INFO] Waiting 4 > [Tremblay:slave from master:(4) 8.000000] [msg_test/INFO] I'm done. See you! -> [Tremblay:master:(1) 8.000000] [msg_test/INFO] Goodbye now! -> [8.000000] [msg_test/INFO] Simulation time 8 +> [Tremblay:slave from master:(5) 10.000000] [msg_test/INFO] I'm done. See you! +> [Tremblay:master:(1) 11.000000] [msg_test/INFO] Join the slave (timeout 1) +> [Tremblay:master:(1) 11.000000] [msg_test/INFO] Goodbye now! +> [Tremblay:master:(1) 12.000000] [msg_test/INFO] Goodbye now! +> [12.000000] [msg_test/INFO] Simulation time 12 -- 2.20.1