/* If the synchro is already finished then perform the error handling */
if (state_ != simgrid::kernel::activity::State::RUNNING)
finish();
- else {
- /* we need a sleep action (even when there is no timeout) to be notified of host failures */
+ else if (timeout == 0.) {
+ // still running and timeout == 0 ? We need to report a timeout
+ state_ = simgrid::kernel::activity::State::TIMEOUT;
+ finish();
+ } else {
+ /* we need a sleep action (even when the timeout is infinite) to be notified of host failures */
set_timeout(timeout);
}
}
XBT_INFO("#####[ launch next test ]#####");
RUN_SECTION("exec: run and wait<0> once", test_trivial<ExecPtr, create_exec, tester_wait<0>>);
- // exec: run and wait<0> many
+ RUN_SECTION("exec: run and wait<0> many", test_basic<ExecPtr, create_exec, tester_wait<0>>);
RUN_SECTION("exec: cancel and wait<0>", test_cancel<ExecPtr, create_exec, tester_wait<0>>);
- // exec: actor failure and wait<0> / sleep
- // exec: host failure and wait<0> / sleep
+ RUN_SECTION("exec: actor failure and wait<0> / sleep",
+ test_failure_actor<ExecPtr, create_exec, tester_wait<0>, waiter_sleep6>);
+ RUN_SECTION("exec: host failure and wait<0> / sleep",
+ test_failure_host<ExecPtr, create_exec, tester_wait<0>, waiter_sleep6>);
// exec: actor failure and wait<0> / wait
// exec: host failure and wait<0> / wait
// with tester_wait<0>
// -> wait_for() should return immediately and signal a timeout (timeout == 0)
- RUN_SECTION("exec: run and wait<0> many", test_basic<ExecPtr, create_exec, tester_wait<0>>);
- // -> wait_for() should return immediately and signal a timeout (timeout == 0)
- RUN_SECTION("exec: actor failure and wait<0> / sleep",
- test_failure_actor<ExecPtr, create_exec, tester_wait<0>, waiter_sleep6>);
- // -> wait_for() should return immediately and signal a timeout (timeout == 0)
- RUN_SECTION("exec: host failure and wait<0> / sleep",
- test_failure_host<ExecPtr, create_exec, tester_wait<0>, waiter_sleep6>);
- // -> wait_for() should return immediately and signal a timeout (timeout == 0)
RUN_SECTION("exec: actor failure and wait<0> / wait",
test_failure_actor<ExecPtr, create_exec, tester_wait<0>, waiter_wait>);
// -> wait_for() should return immediately and signal a timeout (timeout == 0)