shutdown: Destroy kernel last, make test shutdown order consistent#28224
shutdown: Destroy kernel last, make test shutdown order consistent#28224achow101 merged 2 commits intobitcoin:masterfrom
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
|
Are you still working on this? |
|
Yes. |
|
I think there is an outstanding comment: #28224 (comment) ? |
960112d to
99a668c
Compare
|
Updated 960112d -> 99a668c (testSetupDestructorOrder_0 -> testSetupDestructorOrder_1, compare)
|
ryanofsky
left a comment
There was a problem hiding this comment.
Code review ACK 99a668c
Changes look good, but I would suggest changing the PR title to something like: "shutdown: destroy kernel last and make test shutdown order consistent" because the current title "tests: Reset node context members on ~ChainTestingSetup" makes it seems like this is a test-only change.
Also think it would be better to split changes in init.cpp and setup_common.cpp into separate commits. The changes are both related to shutdown but they have different rationales and effects, so it doesn't really make sense for them to be in the same commit.
Currently the shutdown function resets the kernel before the chainman and scheduler. Invert this order by resetting the kernel last, since they might rely on the kernel.
The destruction/resetting of node context members in the tests should roughly follow the behaviour of the Shutdown function in `init.cpp`.
99a668c to
c1144f0
Compare
|
Updated 99a668c -> c1144f0 (testSetupDestructorOrder_1 -> testSetupDestructorOrder_2, compare)
|
|
ACK c1144f0 🗣 Show signatureSignature: |
|
ACK c1144f0 |
The destruction/resetting of node context members in the tests should roughly follow the behavior of the
Shutdownfunction ininit.cpp.This was originally requested by MarcoFalke in this comment in response to the original pull request introducing the
kernel::Context.