Page MenuHomePhabricator

test: Fix inconsistent lock order in wallet_tests/CreateWallet
ClosedPublic

Authored by PiRK on Feb 22 2022, 14:53.

Details

Summary

sync: Improve CheckLastCritical()

This commit adds actual lock stack logging if check fails.

[skip ci] sync: Check precondition in LEAVE_CRITICAL_SECTION() macro

This change reveals a bug in the wallet_tests/CreateWalletFromFile test,
that will be fixed in the following commit.

test: Fix inconsistent lock order in wallet_tests/CreateWallet

This is a backport of core#19982

Test Plan

I confirmed that after commit #2, running ninja check with -DCMAKE_BUILD_TYPE=Debug reveals a lock order issue:

../src/wallet/test/wallet_tests.cpp:853 wallet_param->wallet()->cs_wallet was not most recent critical section locked, details in debug log.

This goes away with the next commit.

Tested also with TSAN, after removing the suppression.