Actually the bug is far simpler than use of "expect".
If the main process dies while the job is in the "stopping" state (stopping event pending), the state is changed in the terminated handler - and thus you hit that assertion.
In the stopping state, process exits should be ignored because we're stopping anyway (just like we ignore failures in the killed state).
Actually the bug is far simpler than use of "expect".
If the main process dies while the job is in the "stopping" state (stopping event pending), the state is changed in the terminated handler - and thus you hit that assertion.
In the stopping state, process exits should be ignored because we're stopping anyway (just like we ignore failures in the killed state).