Skip to content

Commit 7720d4f

Browse files
committed
test: fix failure in feature_nulldummy.py on single-core machines
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 ... The behaviour can be reproduced on a multi-core machine by simply changing the function GetNumCores() (in src/util/system.cpp) to return 1: int GetNumCores() { return 1; }
1 parent 646b388 commit 7720d4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/functional/feature_nulldummy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def set_test_params(self):
5454
self.extra_args = [[
5555
f'-segwitheight={COINBASE_MATURITY + 5}',
5656
'-addresstype=legacy',
57+
'-par=1', # Use only one script thread to get the exact reject reason for testing
5758
]]
5859

5960
def skip_test_if_missing_module(self):
@@ -131,7 +132,7 @@ def block_submit(self, node, txs, *, with_witness=False, accept):
131132
add_witness_commitment(block)
132133
block.rehash()
133134
block.solve()
134-
assert_equal(None if accept else 'block-validation-failed', node.submitblock(block.serialize().hex()))
135+
assert_equal(None if accept else NULLDUMMY_ERROR, node.submitblock(block.serialize().hex()))
135136
if accept:
136137
assert_equal(node.getbestblockhash(), block.hash)
137138
self.lastblockhash = block.hash

0 commit comments

Comments
 (0)