aboutsummaryrefslogtreecommitdiff
path: root/.cirrus.yml
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-26 11:11:36 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-08-26 11:12:03 +0200
commit0492b56e38c24e599a221b5bb276957c674cfafe (patch)
treec79a5eec70f5725abfa46ff012d1f8cbbd1f3a32 /.cirrus.yml
parent3a62b8b77e7b1b08c251551e3cf528f94c3392f8 (diff)
parent7720d4f650015272dc7109238230520f71858c6c (diff)
downloadbitcoin-0492b56e38c24e599a221b5bb276957c674cfafe.tar.xz
Merge bitcoin/bitcoin#22738: test: fix failure in feature_nulldummy.py on single-core machines
7720d4f650015272dc7109238230520f71858c6c test: fix failure in feature_nulldummy.py on single-core machines (Sebastian Falbesoner) 646b3885f795c640a2ac979362c509c4a8ee592a test: refactor: use named args for block_submit in feature_nulldummy.py (Sebastian Falbesoner) Pull request description: On single-core machines, executing the test `feature_nulldummy.py` results in the following assertion error: ``` ... 2021-08-18T15:37:58.805000Z TestFramework (INFO): Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation 2021-08-18T15:37:58.814000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "[...]/test/functional/test_framework/test_framework.py", line 131, in main self.run_test() File "[...]/test/functional/feature_nulldummy.py", line 107, in run_test self.block_submit(self.nodes[0], [test4tx], accept=False) File "[...]/test/functional/feature_nulldummy.py", line 134, in block_submit assert_equal(None if accept else 'block-validation-failed', node.submitblock(block.serialize().hex())) File "[...]/test/functional/test_framework/util.py", line 49, in assert_equal raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args)) AssertionError: not(block-validation-failed == non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero)) 2021-08-18T15:37:58.866000Z TestFramework (INFO): Stopping nodes ... ``` There are hardly any single-core machines around anymore, but the behaviour can be reproduced on a multi-core machine by patching the function `GetNumCores()` to return 1 on the master branch and running `feature_nulldummy.py`: ```diff diff --git a/src/util/system.cpp b/src/util/system.cpp index 30d410381..149b512fc 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -1338,7 +1338,7 @@ bool SetupNetworking() int GetNumCores() { - return std::thread::hardware_concurrency(); + return 1; } ``` As solution, parallel script verification is disabled (`-par=1`) and the exact reject reason is checked, which also increases the precision of the test (the possibility that the block is rejected because of another unintended reason is ruled out). See also related PR #22711 which applies the same approach for the p2p segwit test. The PR also includes a refactoring commit which changes the calls to `self.block_submit()` to use named arguments and removes the default value for parameter `accept` (i.e. explicitely passing `accept=...` is mandatory), with the aim to increase the test readability. ACKs for top commit: josibake: ACK https://github.com/bitcoin/bitcoin/pull/22738/commits/7720d4f650015272dc7109238230520f71858c6c Saviour1001: Tested ACK <code>[7720d4f](https://github.com/bitcoin/bitcoin/commit/7720d4f650015272dc7109238230520f71858c6c)</code> Tree-SHA512: 8a31ebab3e2ab38e555d7a23139b3324a134a0dedc5b879a2419348ae858323882dbbfcbbf88b68e4f8d7eea8cfe43ee19da1d0d2a36c93ae7878c4980cac31d
Diffstat (limited to '.cirrus.yml')
0 files changed, 0 insertions, 0 deletions