Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add teardown actions and stable action order #169

Closed
arcivanov opened this issue Aug 31, 2015 · 0 comments · Fixed by #170
Closed

Add teardown actions and stable action order #169

arcivanov opened this issue Aug 31, 2015 · 0 comments · Fixed by #170

Comments

@arcivanov
Copy link
Member

There is a need to cleanup around tasks. For example there has to be a way to start a server, run integration tests and stop the server if a failure occurs. Not being able to stop a server leaves processes hanging around, requires a cleanup and makes it very hard to debug failures.

Therefore:

  1. Add an attribute to @after, called teardown. The attribute is False by default.
    • If an exception occurs anywhere in @before or in a task or in any of the @after actions, the exception is recorded, then all @after actions with teardown=True are executed
    • While executing teardown @after actions, the errors raised therein are suppressed. The executing actions log their errors without raising them.
    • Once all teardown @after actions are executed the originating error is raised.
  2. Use ordered dictionaries in ExecutionManager to make sure that the order the actions are registered in is the order that actions are executed in. This is important to ensure that behaviors are predictable as far as cleanup order.
@arcivanov arcivanov self-assigned this Aug 31, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Aug 31, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Aug 31, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Aug 31, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 4, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 5, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 5, 2015
@arcivanov arcivanov changed the title Add finalizer actions and stable action order Add teardown actions and stable action order Sep 5, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Sep 5, 2015
@mriehl mriehl removed the in progress label Sep 7, 2015
mriehl added a commit that referenced this issue Sep 7, 2015
Add teardown actions and stable action order #169
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants