#!/usr/bin/env tesh
$ ${bindir:=.}/s4u-exec-failure "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
-> [ 0.000000] (1:Dispatcher@Host1) Initiating asynchronous exec on Host1
-> [ 0.000000] (2:HostKiller@Host1) HostKiller sleeping 10 seconds...
-> [ 0.000000] (1:Dispatcher@Host1) Initiating asynchronous exec on Host2
-> [ 0.000000] (1:Dispatcher@Host1) Calling wait_any..
-> [ 10.000000] (2:HostKiller@Host1) HostKiller turning off host Host2
-> [ 10.000000] (1:Dispatcher@Host1) Dispatcher has experienced a host failure exception, so it knows that something went wrong
-> [ 10.000000] (1:Dispatcher@Host1) Now it needs to figure out which of the two execs failed by looking at their state
-> [ 10.000000] (1:Dispatcher@Host1) Exec on Host1 has state: STARTED
-> [ 10.000000] (1:Dispatcher@Host1) Exec on Host2 has state: FAILED
-> [ 10.000000] (1:Dispatcher@Host1) Waiting on a FAILED exec raises an exception: 'Cannot wait for a failed exec'
-> [ 10.000000] (1:Dispatcher@Host1) Wait for remaining exec, just to be nice
-> [ 10.000000] (2:HostKiller@Host1) HostKiller ends
-> [ 20.000000] (1:Dispatcher@Host1) Dispatcher ends
+> [ 0.000000] (1:Dispatcher@Host3) Initiating asynchronous exec on Host1
+> [ 0.000000] (1:Dispatcher@Host3) Initiating asynchronous exec on Host2
+> [ 0.000000] (1:Dispatcher@Host3) Initiating asynchronous exec on Host3
+> [ 0.000000] (1:Dispatcher@Host3) ---------------------------------
+> [ 0.000000] (1:Dispatcher@Host3) Wait on the first exec, which host is turned off at t=10 by the another actor.
+> [ 10.000000] (2:HostKiller@Host3) HostKiller turns off the host 'Host1'.
+> [ 10.000000] (1:Dispatcher@Host3) Dispatcher has experienced a host failure exception, so it knows that something went wrong.
+> [ 10.000000] (1:Dispatcher@Host3) State of each exec:
+> [ 10.000000] (1:Dispatcher@Host3) Exec on Host1 has state: FAILED
+> [ 10.000000] (1:Dispatcher@Host3) Exec on Host2 has state: STARTED
+> [ 10.000000] (1:Dispatcher@Host3) Exec on Host3 has state: STARTED
+> [ 10.000000] (1:Dispatcher@Host3) ---------------------------------
+> [ 10.000000] (1:Dispatcher@Host3) Wait on the second exec, which host is turned off at t=12 by the state profile.
+> [ 12.000000] (1:Dispatcher@Host3) Dispatcher has experienced a host failure exception, so it knows that something went wrong.
+> [ 12.000000] (1:Dispatcher@Host3) State of each exec:
+> [ 12.000000] (1:Dispatcher@Host3) Exec on Host1 has state: FAILED
+> [ 12.000000] (1:Dispatcher@Host3) Exec on Host2 has state: FAILED
+> [ 12.000000] (1:Dispatcher@Host3) Exec on Host3 has state: STARTED
+> [ 12.000000] (1:Dispatcher@Host3) ---------------------------------
+> [ 12.000000] (1:Dispatcher@Host3) Wait on the third exec, which should succeed.
+> [ 20.000000] (1:Dispatcher@Host3) No exception occured.
+> [ 20.000000] (1:Dispatcher@Host3) State of each exec:
+> [ 20.000000] (1:Dispatcher@Host3) Exec on Host1 has state: FAILED
+> [ 20.000000] (1:Dispatcher@Host3) Exec on Host2 has state: FAILED
+> [ 20.000000] (1:Dispatcher@Host3) Exec on Host3 has state: FINISHED
\ No newline at end of file