Closed sphuber closed 2 years ago
Base: 90.46% // Head: 90.68% // Increases project coverage by +0.23%
:tada:
Coverage data is based on head (
184ba7a
) compared to base (7a218ac
). Patch coverage: 100.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Fixes #219
Before, if a state transition failed a transition to the excepted state would be initiated. However, if the original failure came from a method that would be called in all state transitions, i.e. also when transitioning to the excepted, it would be guaranteed to be hit again. In the second transition failure, the exception would simply be raised again and bubble up.
In the case of a transition failure and so
self._transition_failed
is set toTrue
, the current state should not be explicitly exited but one should transition straight to the excepted state.This change now effectively allows the state machine to transition from a
FINISHED
state to theEXCEPTED
state. A process could transition to theFINISHED
state and on exiting theFINISHED
state, an exception could be raised. In this case the result of the future would already be set, so theon_except
method needs to check for this, and when set, first reset the future before setting the exception.This PR also has two other commits, one with a small feature and a small bug fix.