From: Arnaud Giersch Date: Thu, 4 Jul 2019 13:50:58 +0000 (+0200) Subject: Fixed simgrid/simgrid#27. X-Git-Tag: v3.23.2~12 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c121e4adb7803ead1a3abdb1cba8f04fd0155880 Fixed simgrid/simgrid#27. --- diff --git a/ChangeLog b/ChangeLog index a92e66e74f..ae77a7f32e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ XBT: Bugs: - Really fix FG#26: Turning off a link should raise NetworkFailureException + - FG#27: Wrong exception thrown to wait_any when link is turned off ---------------------------------------------------------------------------- diff --git a/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp b/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp index 70e0fc828d..8443888a52 100644 --- a/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp +++ b/teshsuite/s4u/activity-lifecycle/activity-lifecycle.cpp @@ -479,10 +479,8 @@ static void test_link_off_during_transfer() static void test_link_off_during_wait_any() { - const double start = simgrid::s4u::Engine::get_clock(); - - simgrid::s4u::ActorPtr receiver = simgrid::s4u::Actor::create("receiver", all_hosts[1], [&start]() { - assert_exit(false, start + 2); + simgrid::s4u::ActorPtr receiver = simgrid::s4u::Actor::create("receiver", all_hosts[1], []() { + assert_exit(false, 2); bool receiver_got_network_failure_execution = false; bool receiver_got_base_execution = false; int *data; @@ -502,8 +500,8 @@ static void test_link_off_during_wait_any() xbt_assert(not receiver_got_base_execution, "The receiver should not have gotten a base Exception"); }); - simgrid::s4u::ActorPtr sender = simgrid::s4u::Actor::create("sender", all_hosts[2], [&start]() { - assert_exit(false, start + 2); + simgrid::s4u::ActorPtr sender = simgrid::s4u::Actor::create("sender", all_hosts[2], []() { + assert_exit(false, 2); int data = 42; bool sender_got_network_failure_execution = false; bool sender_got_base_execution = false; @@ -520,9 +518,12 @@ static void test_link_off_during_wait_any() xbt_assert(not sender_got_base_execution, "The sender should not have gotten a base Exception"); }); - simgrid::s4u::this_actor::sleep_for(2.0); - XBT_VERB("link off"); - simgrid::s4u::Link::by_name("link1")->turn_off(); + simgrid::s4u::this_actor::sleep_for(2.0); + XBT_VERB("link off"); + simgrid::s4u::Link::by_name("link1")->turn_off(); + simgrid::s4u::this_actor::sleep_for(2.0); + XBT_VERB("link on"); + simgrid::s4u::Link::by_name("link1")->turn_on(); }