aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-01-31 02:50:40 +1300
committerMarcoFalke <falke.marco@gmail.com>2020-01-31 02:50:47 +1300
commit0130abbdb7f5e2a290901064b5ae09097afe2139 (patch)
treefa704129c2d1acd26b07f12243ac3baa070dae87
parent44c2400bccbc6e77416e9debbeedbeed5cdc0eac (diff)
parent1b96a3cd1ebe725896f59614903184289fe62cf8 (diff)
Merge #18018: tests: reset fIsBareMultisigStd after bare-multisig tests
1b96a3cd1ebe725896f59614903184289fe62cf8 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 https://github.com/bitcoin/bitcoin/pull/18018/commits/1b96a3cd1ebe725896f59614903184289fe62cf8 theStack: ACK https://github.com/bitcoin/bitcoin/pull/18018/commits/1b96a3cd1ebe725896f59614903184289fe62c Tree-SHA512: fd7578f9f3faa44d236cd007fc25e31f061acabdb8458559fde0e67d11ab5cafed15305993270c9943a50326574bc5f5301b09494a5b0d2de69e64978093ed45
-rw-r--r--src/test/transaction_tests.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index 0939803953..fb45ce0ee6 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -831,6 +831,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
reason.clear();
BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
BOOST_CHECK_EQUAL(reason, "bare-multisig");
+ fIsBareMultisigStd = DEFAULT_PERMIT_BAREMULTISIG;
}
BOOST_AUTO_TEST_SUITE_END()