-
Notifications
You must be signed in to change notification settings - Fork 116
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
Ensure correct finalizer order #14620
Ensure correct finalizer order #14620
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting how the finalizers work as a stack. My recommendation would be to flip the order of creation. Make the HG then the host and leave finalizers right after each create. Although this works too.
Wouldn't that change the test logic? robottelo/tests/foreman/api/test_parameters.py Lines 28 to 30 in cb296b3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overall like this approach better than the fixture-heavy one. However, I will block on changing creation order (and yes the test logic order) to create the hostgroup first, then add its finalizer before creating the host. This is the best balance between ensuring finalizer execution order and actual execution if something goes wrong between entity creation and finalizer addition.
cb296b3
to
2927fca
Compare
the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment)
2927fca
to
be19f79
Compare
trigger: test-robottelo |
PRT Result
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, thanks for taking this on!
the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment) (cherry picked from commit 8eea8dc)
the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment) (cherry picked from commit 8eea8dc)
the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment) (cherry picked from commit 8eea8dc)
Ensure correct finalizer order (#14620) the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment) (cherry picked from commit 8eea8dc) Co-authored-by: dosas <dosas@users.noreply.github.com>
Ensure correct finalizer order (#14620) the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment) (cherry picked from commit 8eea8dc) Co-authored-by: dosas <dosas@users.noreply.github.com>
Ensure correct finalizer order (#14620) the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment) (cherry picked from commit 8eea8dc) Co-authored-by: dosas <dosas@users.noreply.github.com>
the host was not deleted before the hostgroup see: pytest-dev/pytest#10023 (comment)
Problem Statement
the host was not deleted before the hostgroup
see: pytest-dev/pytest#10023 (comment)
Solution
Execute host finalizer after hostgroup finalizer
Note
This should replace #14568