Skip to content

Commit c1144f0

Browse files
committed
tests: Reset node context members on ~BasicTestingSetup
The destruction/resetting of node context members in the tests should roughly follow the behaviour of the Shutdown function in `init.cpp`.
1 parent 9759af1 commit c1144f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/test/util/setup_common.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vecto
144144

145145
BasicTestingSetup::~BasicTestingSetup()
146146
{
147+
m_node.kernel.reset();
147148
SetMockTime(0s); // Reset mocktime for following tests
148149
LogInstance().DisconnectTestLogger();
149150
fs::remove_all(m_path_root);
@@ -202,8 +203,9 @@ ChainTestingSetup::~ChainTestingSetup()
202203
m_node.netgroupman.reset();
203204
m_node.args = nullptr;
204205
m_node.mempool.reset();
205-
m_node.scheduler.reset();
206+
m_node.fee_estimator.reset();
206207
m_node.chainman.reset();
208+
m_node.scheduler.reset();
207209
}
208210

209211
void ChainTestingSetup::LoadVerifyActivateChainstate()

0 commit comments

Comments
 (0)