Skip to content

Commit 66576c4

Browse files
committed
test: Clear forced -walletdir setting after wallet init_tests
Leaving this value set interfered with the CreateWallet test if it happened to execute later in the test ordering. Specifically it would cause CreateWallet test to write data to the current directory instead of temporary test directory.
1 parent 32e59fc commit 66576c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/test/init_test_fixture.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <fs.h>
6+
#include <univalue.h>
67
#include <util/check.h>
78
#include <util/system.h>
89

@@ -37,6 +38,9 @@ InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainNam
3738

3839
InitWalletDirTestingSetup::~InitWalletDirTestingSetup()
3940
{
41+
gArgs.LockSettings([&](util::Settings& settings) {
42+
settings.forced_settings.erase("walletdir");
43+
});
4044
fs::current_path(m_cwd);
4145
}
4246

0 commit comments

Comments
 (0)