Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Tests were wrong, fix them.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 12 Feb 2021 11:24:35 +0000 (12:24 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 12 Feb 2021 11:37:03 +0000 (12:37 +0100)
teshsuite/s4u/activity-lifecycle/testing_test-wait.cpp

index 6aa60c1..52d79a5 100644 (file)
@@ -132,9 +132,11 @@ template <creator_type Create, tester_type Test, waiter_type Wait> void test_fai
     Wait(activity);
     FAIL("should not be here!");
   });
-  simgrid::s4u::this_actor::sleep_for(2.0);
+  const double timestep = simgrid::s4u::Engine::get_clock() + 2.0;
+  simgrid::s4u::this_actor::sleep_for(1.0);
   INFO("activity should be still running");
   REQUIRE(not Test(activity));
+  simgrid::s4u::this_actor::sleep_until(timestep);
   actor->kill();
   INFO("activity should be terminated now");
   REQUIRE(Test(activity));
@@ -151,9 +153,11 @@ template <creator_type Create, tester_type Test, waiter_type Wait> void test_fai
     Wait(activity);
     FAIL("should not be here!");
   });
-  simgrid::s4u::this_actor::sleep_for(2.0);
+  const double timestep = simgrid::s4u::Engine::get_clock() + 2.0;
+  simgrid::s4u::this_actor::sleep_for(1.0);
   INFO("activity should be still running");
   REQUIRE(not Test(activity));
+  simgrid::s4u::this_actor::sleep_until(timestep);
   actor->get_host()->turn_off();
   actor->get_host()->turn_on();
   INFO("activity should be terminated now");