Skip to content

Commit 0130abb

Browse files
author
MarcoFalke
committed
Merge #18018: tests: reset fIsBareMultisigStd after bare-multisig tests
1b96a3c tests: reset fIsBareMultisigStd after bare-multisig tests (fanquake) Pull request description: Fixes: #18015 The bug this fixes is two-part. 1. The `fIsBareMultisigStd` global is being reused by other tests, such as [script_p2sh_tests(set)](https://github.com/bitcoin/bitcoin/blob/master/src/test/script_p2sh_tests.cpp#L150), after being set to false. 2. The order our tests run in doesn't always? seem to be random, which meant that the `script_p2sh` tests would only fail if they were run in an order where the `transaction_tests` ran first, mutating the `fIsBareMultisigStd` global. This doesn't seem to happen when running make check, but if you run `src/test/test_bitcoin and pass --random=99999`, the failure in `script_p2sh` will occur (on most, but maybe not all systems): ```bash src/test/test_bitcoin --random=99999 Running 389 test cases... test/script_p2sh_tests.cpp:200: error: in "script_p2sh_tests/set": txTo[1].IsStandard test/script_p2sh_tests.cpp:200: error: in "script_p2sh_tests/set": txTo[2].IsStandard test/script_p2sh_tests.cpp:200: error: in "script_p2sh_tests/set": txTo[3].IsStandard *** 3 failures are detected in the test module "Bitcoin Core Test Suite" ``` The new test for bare multisig was introduced in #17502. ACKs for top commit: Empact: Code Review ACK bitcoin/bitcoin@1b96a3c theStack: ACK bitcoin/bitcoin@1b96a3c Tree-SHA512: fd7578f9f3faa44d236cd007fc25e31f061acabdb8458559fde0e67d11ab5cafed15305993270c9943a50326574bc5f5301b09494a5b0d2de69e64978093ed45
2 parents 44c2400 + 1b96a3c commit 0130abb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/test/transaction_tests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
831831
reason.clear();
832832
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
833833
BOOST_CHECK_EQUAL(reason, "bare-multisig");
834+
fIsBareMultisigStd = DEFAULT_PERMIT_BAREMULTISIG;
834835
}
835836

836837
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)