Should we also not add the checks from lines 899 to 909 in the loaded wallet test below?
If it makes sense, then maybe we can consider calling test_failed_migration_cleanup twice from run_test with boolean loaded_wallet as an argument to the test.
Yeah, that’s possible, but I’m not sure it’s worth the refactoring since we’re planning to remove BDB soon (this extra test will be removed too).
Also, running it from run_test in two different ways would require creating a different wallet for each run (because create_legacy_wallet can’t be called with the same name twice), which would mean decoupling the wallet name into a variable, which requires a good number of lines changes. Another option is to create a test_failed_migration_cleanup inner function post-setup and call it twice, e.g. 393c506533a1183225d767d18dd54c3d961e1a28.